Fix assumptions about header value types

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-08-12 20:56:31 +00:00
parent 40bf9965ac
commit 767b7c72f7

View File

@ -60,8 +60,9 @@ impl Response {
#( #cfg_attrs )*
#field_name: {
headers.remove(#header_name)
.map(|h| h.to_str().map(|s| s.to_owned()))
.map(|h| h.to_str().map(str::to_owned))
.transpose()?
.map(Into::into)
}
}
}
@ -71,7 +72,7 @@ impl Response {
headers.remove(#header_name)
.expect("response missing expected header")
.to_str()?
.to_owned()
.into()
}
},
};