Add example "cureq". (#330)

Contrary to smoke-test, this takes full URLs on the commandline and
prints their contents to stdout. This makes it easier to test behavior
with specific URLs. I hope to later add flags for various behaviors like
printing headers, following redirects, enabling / disabling cookies,
and verbose output.

Also add a useful debug line when receiving a cookie header.
This commit is contained in:
Jacob Hoffman-Andrews
2021-02-21 14:26:12 -08:00
committed by GitHub
parent 7222931b24
commit 6f86ee7f93
3 changed files with 133 additions and 0 deletions

View File

@@ -411,6 +411,10 @@ fn save_cookies(unit: &Unit, resp: &Response) {
return;
}
let cookies = headers.into_iter().flat_map(|header_value| {
debug!(
"received 'set-cookie: {}' from {} {}",
header_value, unit.method, unit.url
);
match Cookie::parse(header_value.to_string()) {
Err(_) => None,
Ok(c) => Some(c),