mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #15868 - servo:hyper, r=jdm
Update Hyper and OpenSSL <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15868) <!-- Reviewable:end -->
This commit is contained in:
commit
82b0d5ad54
70 changed files with 645 additions and 486 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cookie_rs;
|
||||
use core::nonzero::NonZero;
|
||||
use devtools_traits::ScriptToDevtoolsControlMsg;
|
||||
use document_loader::{DocumentLoader, LoadType};
|
||||
|
@ -3285,15 +3286,15 @@ impl DocumentMethods for Document {
|
|||
return Err(Error::Security);
|
||||
}
|
||||
|
||||
let header = Header::parse_header(&[cookie.into()]);
|
||||
if let Ok(SetCookie(cookies)) = header {
|
||||
let cookies = cookies.into_iter().map(Serde).collect();
|
||||
if let Ok(cookie_header) = SetCookie::parse_header(&vec![cookie.to_string().into_bytes()]) {
|
||||
let cookies = cookie_header.0.into_iter().filter_map(|cookie| {
|
||||
cookie_rs::Cookie::parse(cookie).ok().map(Serde)
|
||||
}).collect();
|
||||
let _ = self.window
|
||||
.upcast::<GlobalScope>()
|
||||
.resource_threads()
|
||||
.send(SetCookiesForUrl(self.url(), cookies, NonHTTP));
|
||||
.upcast::<GlobalScope>()
|
||||
.resource_threads()
|
||||
.send(SetCookiesForUrl(self.url(), cookies, NonHTTP));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue