mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Cookie header values can be utf8
This commit is contained in:
parent
2b3c4eba2d
commit
fc13bd8b2f
3 changed files with 2 additions and 15 deletions
|
@ -272,7 +272,7 @@ fn set_cookies_from_headers(
|
|||
cookie_jar: &RwLock<CookieStorage>,
|
||||
) {
|
||||
for cookie in headers.get_all(header::SET_COOKIE) {
|
||||
if let Ok(cookie_str) = cookie.to_str() {
|
||||
if let Ok(cookie_str) = std::str::from_utf8(cookie.as_bytes()) {
|
||||
set_cookie_for_url(&cookie_jar, &url, &cookie_str);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
[charset-tests.html]
|
||||
[charset0002 - charset0002]
|
||||
expected: FAIL
|
||||
|
||||
[charset0003 - charset0003]
|
||||
expected: FAIL
|
||||
|
||||
[charset0004 - charset0004]
|
||||
expected: FAIL
|
||||
|
||||
[charset0001 - charset0001]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue