Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] ureq proxy agent failing #12494

Open
qinghai5060 opened this issue Jan 24, 2025 · 1 comment
Open

[bug] ureq proxy agent failing #12494

qinghai5060 opened this issue Jan 24, 2025 · 1 comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@qinghai5060
Copy link

qinghai5060 commented Jan 24, 2025

#7338
I don't know where the problem is, but I tried with the reqwest library and it is OK. Can anyone rewrite this block of code?

file

fn create_agent_and_url(url: &str) -> (ureq::Agent, String) {
  generate_github_alternative_url(url).unwrap_or((
    ureq::AgentBuilder::new().try_proxy_from_env(true).build(),
    url.to_owned(),
  ))
}

#[allow(dead_code)]
pub fn download(url: &str) -> crate::Result<Vec<u8>> {
  let (agent, final_url) = create_agent_and_url(url);

  log::info!(action = "Downloading"; "{}", final_url);

  let response = agent.get(&final_url).call().map_err(Box::new)?;
  let mut bytes = Vec::new();
  response.into_reader().read_to_end(&mut bytes)?;
  Ok(bytes)
}
@FabianLars
Copy link
Member

We'd really rather not do that. Can you tell us a bit about your problem? Like your proxy set up and the errors you're seeing if any. (also try with the --verbose flag)

@FabianLars FabianLars added type: bug status: needs triage This issue needs to triage, applied to new issues labels Jan 24, 2025
@FabianLars FabianLars changed the title can anybody rewrite this code with reqwest lib? [bug] ureq proxy agent failing Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants