mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use get_mut instead of get-remove-set in XHR send()
This commit is contained in:
parent
00af25b685
commit
fc6e20f652
11 changed files with 30 additions and 34 deletions
|
@ -635,7 +635,7 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
}
|
||||
|
||||
if !content_type_set {
|
||||
let ct = request.headers.get::<ContentType>().map(|x| x.clone());
|
||||
let ct = request.headers.get_mut::<ContentType>();
|
||||
if let Some(mut ct) = ct {
|
||||
if let Some(encoding) = encoding {
|
||||
for param in &mut (ct.0).2 {
|
||||
|
@ -646,10 +646,6 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
|
|||
}
|
||||
}
|
||||
}
|
||||
// remove instead of mutate in place
|
||||
// https://github.com/hyperium/hyper/issues/821
|
||||
request.headers.remove_raw("content-type");
|
||||
request.headers.set(ct);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue