Adding a UserAgent header to the http downloader

[?]
Jun 3, 2021, 10:08 AM
AI73GKAO5QBPR6YGW7H5UNZYAEGYGIHAFO6DM2DWCPMVYLHE547QC

Dependencies

  • [2] GFED4ORA Improve error handling for nonexistent channels
  • [3] IQ4FCHPZ HTTP connections: pooling + retry on error
  • [4] KI2AFWOS Fixing a panic in pull
  • [5] JRENVH5D Reqwest 0.11
  • [6] BVVMTOYW Proper renaming of changes downloaded over HTTP
  • [7] VBMXB443 Retrying if the HTTP connection drops while reading the body
  • [8] MU5GSJAW Partial push and pull (WARNING: breaks the existing protocol)
  • [9] TPEH2XNB 1.0.0-alpha.28, with Tokio 1.0
  • [10] GYXIF25T Proper parsing of URLs
  • [*] FBXYP7QM Forgot to add remote::http
  • [*] 367UBQ6K Forwarding SSH stderr, and progress bar for push

Change contents

  • edit in pijul/src/remote/http.rs at line 9
    [3.25]
    [12.87]
    const USER_AGENT: &str = concat!("pijul-", clap::crate_version!());
  • replacement in pijul/src/remote/http.rs at line 34
    [3.11][3.0:98]()
    let mut res = if let Ok(res) = client.get(&url).query(&[("change", &c32)]).send().await {
    [3.11]
    [3.173]
    let mut res = if let Ok(res) = client
    .get(&url)
    .query(&[("change", &c32)])
    .header(reqwest::header::USER_AGENT, USER_AGENT)
    .send()
    .await
    {
  • edit in pijul/src/remote/http.rs at line 159
    [13.1727]
    [13.1727]
    .header(reqwest::header::USER_AGENT, USER_AGENT)
  • replacement in pijul/src/remote/http.rs at line 190
    [3.5584][3.1856:1924]()
    let res = self.client.get(url).query(&query).send().await?;
    [3.5584]
    [2.0]
    let res = self
    .client
    .get(url)
    .query(&query)
    .header(reqwest::header::USER_AGENT, USER_AGENT)
    .send()
    .await?;
  • replacement in pijul/src/remote/http.rs at line 246
    [3.683][3.248:313]()
    let res = self.client.get(&url).query(&q).send().await?;
    [3.683]
    [3.757]
    let res = self
    .client
    .get(&url)
    .query(&q)
    .header(reqwest::header::USER_AGENT, USER_AGENT)
    .send()
    .await?;
  • replacement in pijul/src/remote/http.rs at line 300
    [3.2101][3.354:391]()
    let res = res.send().await?;
    [3.2101]
    [3.2147]
    let res = res
    .header(reqwest::header::USER_AGENT, USER_AGENT)
    .send()
    .await?;