aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/request.rs
diff options
context:
space:
mode:
authorJeena Lee <ijeenalee@gmail.com>2016-11-07 21:52:58 -0800
committerJeena Lee <ijeenalee@gmail.com>2016-11-07 21:56:45 -0800
commitbfd999f71e198cffb7b1e84d1848c871937e3bd8 (patch)
tree7b483fa26add60a6d3337ed01075052410f7a9af /components/script/dom/request.rs
parente821da81ce89c205a7708e1448c5ca4d1e181b17 (diff)
downloadservo-bfd999f71e198cffb7b1e84d1848c871937e3bd8.tar.gz
servo-bfd999f71e198cffb7b1e84d1848c871937e3bd8.zip
Fill r's headers with headers_copy when HeadersInit::Headers is given
Instead of filling request's headers whenever a `HeadersInit` is given, this patch fills request's headers only when `HeadersInit` with a type of `Headers` is given. Previously, the constructor tried to fill request's headers with itself, causing Servo to crash.
Diffstat (limited to 'components/script/dom/request.rs')
-rw-r--r--components/script/dom/request.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs
index ad328b2c269..8b64bca337b 100644
--- a/components/script/dom/request.rs
+++ b/components/script/dom/request.rs
@@ -361,7 +361,8 @@ impl Request {
try!(r.Headers().fill(Some(HeadersInit::Headers(input_request.Headers()))));
}
},
- Some(_) => try!(r.Headers().fill(Some(HeadersInit::Headers(headers_copy)))),
+ Some(HeadersInit::Headers(_)) => try!(r.Headers().fill(Some(HeadersInit::Headers(headers_copy)))),
+ _ => {},
}
// Step 32