Skip to content

Commit

Permalink
chore(deps): update ureq requirement from 2.10.1 to 3.0.0 (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Sully <[email protected]>
  • Loading branch information
dependabot[bot] and sd2k authored Jan 30, 2025
1 parent e493801 commit 6077c79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/augurs-prophet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ serde_json = { workspace = true, optional = true }
tempfile = { version = "3.13.0", optional = true }
thiserror.workspace = true
tracing.workspace = true
ureq = { version = "2.10.1", optional = true }
ureq = { version = "3.0.0", optional = true }
wasmtime = { version = "29", features = [
"runtime",
"component-model",
Expand Down
9 changes: 6 additions & 3 deletions crates/augurs-prophet/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,22 @@ fn wheel_url() -> Result<&'static str> {

fn download(url: &str, dest: &Path) -> Result<()> {
let resp = ureq::get(url)
.set("User-Agent", "augurs-prophet")
.header("User-Agent", "augurs-prophet")
.call()
.with_context(|| format!("error fetching url {url}"))?;
let len: u64 = resp
.header("Content-Length")
.headers()
.get("Content-Length")
.context("missing content-length header")?
.to_str()
.context("invalid content-length header")?
.parse()
.context("invalid content-length header")?;

let mut file = File::create(dest)
.with_context(|| format!("couldn't create file at {}", dest.display()))?;

let mut body = resp.into_reader().take(len);
let mut body = resp.into_body().into_reader().take(len);
io::copy(&mut body, &mut file).context("error writing wheel to file")?;
Ok(())
}
Expand Down

0 comments on commit 6077c79

Please sign in to comment.