summaryrefslogtreecommitdiffstats
path: root/tests/common
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/mod.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index 8d5497e..661e248 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -523,7 +523,15 @@ impl Web {
Err(e) => panic!("GET {path}: {e}"),
};
let cookie = r.header("set-cookie").map(|s| s.to_string()).unwrap_or_default();
- (vec![("set-cookie".to_string(), cookie)], r.into_string().unwrap_or_default())
+ let mut headers = vec![("set-cookie".to_string(), cookie)];
+ // ureq 2 will not hand out the whole header map, but it will answer for a
+ // named one, which is all the assertions below need.
+ for name in ["content-type", "content-encoding", "location"] {
+ if let Some(v) = r.header(name) {
+ headers.push((name.to_string(), v.to_string()));
+ }
+ }
+ (headers, r.into_string().unwrap_or_default())
}
pub fn get(&self, path: &str) -> Page {