Cookie header values can be utf8

This commit is contained in:
Patrick Shaughnessy 2020-01-28 12:47:18 -05:00
parent 2b3c4eba2d
commit fc13bd8b2f
3 changed files with 2 additions and 15 deletions

View file

@ -92,7 +92,7 @@ impl<'a> Handler for Client<'a> {
let mut jar = self.http_state.cookie_jar.write().unwrap();
// TODO(eijebong): Replace thise once typed headers settled on a cookie impl
for cookie in headers.get_all(header::SET_COOKIE) {
if let Ok(s) = cookie.to_str() {
if let Ok(s) = std::str::from_utf8(cookie.as_bytes()) {
if let Some(cookie) =
Cookie::from_cookie_string(s.into(), self.resource_url, CookieSource::HTTP)
{