Skip to content

Commit 325499d

Browse files
committed
ensure HTTP response status is 200
1 parent 2286d5e commit 325499d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ fn main() {
102102
VERSION, download_filename
103103
);
104104
let mut downloaded_bytes = Vec::new();
105+
let resp = ureq::get(&url).call();
106+
assert_eq!(resp.status(), 200);
105107

106-
let _size = ureq::get(&url)
107-
.call()
108+
let _size = resp
108109
.into_reader()
109110
.read_to_end(&mut downloaded_bytes)
110111
.unwrap();
111-
112112
let downloaded_hash = sha256::Hash::hash(&downloaded_bytes);
113113
assert_eq!(expected_hash, downloaded_hash);
114114
let d = GzDecoder::new(&downloaded_bytes[..]);

0 commit comments

Comments
 (0)