mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Auto merge of #9608 - nikkisquared:implement_http_redirect_fetch, r=jdm
Implementation of HTTP Redirect Fetch step I've made a first draft of a complete implementation of HTTP Redirect Fetch, most of which is just refactored out of HTTP Fetch. I've also made some minor changes in a few other steps, all collected in the second commit, based on recent changes to the Fetch Standard. Since HTTP Redirect Fetch is so new, I figured now would be a fine time to make those other changes. The biggest thing on my mind right now is how the spec says[1] "This algorithm will be used by HTML's "navigate" algorithm in addition to HTTP fetch above." This makes me think that this function, as well as HTTP Fetch, need to public, or at least have a public-facing function- since each Fetch function takes an Rc<Request>, which might be weird to require callers to supply. [1] https://fetch.spec.whatwg.org/#http-redirect-fetch <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9608) <!-- Reviewable:end -->
This commit is contained in:
commit
88afe38092
3 changed files with 248 additions and 131 deletions
|
@ -93,7 +93,7 @@ pub struct Request {
|
|||
pub url_list: RefCell<Vec<Url>>,
|
||||
pub headers: RefCell<Headers>,
|
||||
pub unsafe_request: bool,
|
||||
pub body: Option<Vec<u8>>,
|
||||
pub body: RefCell<Option<Vec<u8>>>,
|
||||
pub preserve_content_codings: bool,
|
||||
// pub client: GlobalRef, // XXXManishearth copy over only the relevant fields of the global scope,
|
||||
// not the entire scope to avoid the libscript dependency
|
||||
|
@ -101,7 +101,7 @@ pub struct Request {
|
|||
pub skip_service_worker: Cell<bool>,
|
||||
pub context: Context,
|
||||
pub context_frame_type: ContextFrameType,
|
||||
pub origin: Origin,
|
||||
pub origin: RefCell<Origin>,
|
||||
pub force_origin_header: bool,
|
||||
pub omit_origin_header: bool,
|
||||
pub same_origin_data: Cell<bool>,
|
||||
|
@ -129,13 +129,13 @@ impl Request {
|
|||
url_list: RefCell::new(vec![url]),
|
||||
headers: RefCell::new(Headers::new()),
|
||||
unsafe_request: false,
|
||||
body: None,
|
||||
body: RefCell::new(None),
|
||||
preserve_content_codings: false,
|
||||
is_service_worker_global_scope: is_service_worker_global_scope,
|
||||
skip_service_worker: Cell::new(false),
|
||||
context: context,
|
||||
context_frame_type: ContextFrameType::ContextNone,
|
||||
origin: origin,
|
||||
origin: RefCell::new(origin),
|
||||
force_origin_header: false,
|
||||
omit_origin_header: false,
|
||||
same_origin_data: Cell::new(false),
|
||||
|
@ -166,13 +166,13 @@ impl Request {
|
|||
url_list: RefCell::new(vec![url]),
|
||||
headers: RefCell::new(Headers::new()),
|
||||
unsafe_request: false,
|
||||
body: None,
|
||||
body: RefCell::new(None),
|
||||
preserve_content_codings: false,
|
||||
is_service_worker_global_scope: is_service_worker_global_scope,
|
||||
skip_service_worker: Cell::new(false),
|
||||
context: context,
|
||||
context_frame_type: ContextFrameType::ContextNone,
|
||||
origin: origin,
|
||||
origin: RefCell::new(origin),
|
||||
force_origin_header: false,
|
||||
same_origin_data: Cell::new(false),
|
||||
omit_origin_header: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue