Kill Request::omit_origin_header

This commit is contained in:
Anthony Ramine 2017-04-07 11:47:57 +02:00
parent 10801caefd
commit 9394469ede
3 changed files with 6 additions and 14 deletions

View file

@ -824,14 +824,11 @@ fn http_network_or_cache_fetch(request: &mut Request,
};
// Step 11
if !http_request.omit_origin_header {
let method = &http_request.method;
if cors_flag || (*method != Method::Get && *method != Method::Head) {
debug_assert!(http_request.origin != Origin::Client);
if let Origin::Origin(ref url_origin) = http_request.origin {
if let Some(hyper_origin) = try_immutable_origin_to_hyper_origin(url_origin) {
http_request.headers.set(hyper_origin)
}
if cors_flag || (http_request.method != Method::Get && http_request.method != Method::Head) {
debug_assert!(http_request.origin != Origin::Client);
if let Origin::Origin(ref url_origin) = http_request.origin {
if let Some(hyper_origin) = try_immutable_origin_to_hyper_origin(url_origin) {
http_request.headers.set(hyper_origin)
}
}
}