Skip to content

Commit

Permalink
Add redirect_mode to RequestInit
Browse files Browse the repository at this point in the history
  • Loading branch information
rnestler committed Nov 8, 2016
1 parent 1153ca9 commit d25b720
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/net_traits/request.rs
Expand Up @@ -81,7 +81,7 @@ pub enum CacheMode {
}

/// [Redirect mode](https://fetch.spec.whatwg.org/#concept-request-redirect-mode)
#[derive(Copy, Clone, PartialEq, HeapSizeOf)]
#[derive(Copy, Clone, PartialEq, Serialize, Deserialize, HeapSizeOf)]
pub enum RedirectMode {
Follow,
Error,
Expand Down Expand Up @@ -137,6 +137,7 @@ pub struct RequestInit {
pub referrer_url: Option<Url>,
pub referrer_policy: Option<ReferrerPolicy>,
pub pipeline_id: Option<PipelineId>,
pub redirect_mode: RedirectMode,
}

impl Default for RequestInit {
Expand All @@ -158,6 +159,7 @@ impl Default for RequestInit {
referrer_url: None,
referrer_policy: None,
pipeline_id: None,
redirect_mode: RedirectMode::Follow,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions components/script/fetch.rs
Expand Up @@ -61,6 +61,7 @@ fn request_init_from_request(request: NetTraitsRequest) -> NetTraitsRequestInit
referrer_url: from_referrer_to_referrer_url(&request),
referrer_policy: request.referrer_policy.get(),
pipeline_id: request.pipeline_id.get(),
redirect_mode: request.redirect_mode.get(),
}
}

Expand Down

0 comments on commit d25b720

Please sign in to comment.