You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case below, ureq return "Content-Length" response header with empty value, while did return actually with browser and curl curl -v -A fuelup https://raw.githubusercontent.com/FuelLabs/fuelup/gh-pages/channel-fuel-beta-4.toml
ureq = "2.9.1"
use anyhow::{anyhow,Result};use std::env;use ureq::Response;pubfnbuild_agent() -> Result<ureq::Agent>{let agent_builder = ureq::builder().user_agent("fuelup");ifletOk(proxy) = env::var("http_proxy"){returnOk(agent_builder.proxy(ureq::Proxy::new(proxy)?).build());}Ok(agent_builder.build())}#[test]fntest_agent() -> anyhow::Result<()>{
/ / this test case is used to illustrate the bug of ureq that sometimes doesn't return"Content-Length" header
let handle = build_agent()?;let response = handle.get("https://raw.githubusercontent.com/FuelLabs/fuelup/gh-pages/channel-fuel-beta-4.toml").call()?;assert!(response.header("Content-Length").is_none());assert_eq!(response.status(), 200);Ok(())}
The text was updated successfully, but these errors were encountered:
i'm not certain, but based on the following comment, i think ureq might ignore content-length header if the response was decoded by gzip feature. #600 (comment)
In the case below, ureq return "Content-Length" response header with empty value, while did return actually with browser and curl
curl -v -A fuelup https://raw.githubusercontent.com/FuelLabs/fuelup/gh-pages/channel-fuel-beta-4.toml
The text was updated successfully, but these errors were encountered: