mirror of
https://github.com/servo/servo.git
synced 2025-09-23 13:20:11 +01:00
XMLHttpRequest
Send
: fix Content-Type failures (#38993)
Replaced usage of `typed_insert` since it ended converting `UTF-8` to lowercase. Removed one of the test cases since it wasn't following spec since [xhr/205](https://github.com/whatwg/xhr/pull/205). Testing: Changes covered by wpt Fixes: #20436 --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
parent
cb64def7e6
commit
908c392219
5 changed files with 7 additions and 32 deletions
|
@ -739,7 +739,7 @@ impl XMLHttpRequestMethods<crate::DomTypeHolder> for XMLHttpRequest {
|
|||
.collect();
|
||||
|
||||
let new_mime = format!(
|
||||
"{}/{}; charset={}{}{}",
|
||||
"{}/{};charset={}{}{}",
|
||||
mime.type_,
|
||||
mime.subtype,
|
||||
encoding,
|
||||
|
@ -750,9 +750,11 @@ impl XMLHttpRequestMethods<crate::DomTypeHolder> for XMLHttpRequest {
|
|||
.collect::<Vec<String>>()
|
||||
.join("; ")
|
||||
);
|
||||
request
|
||||
.headers
|
||||
.typed_insert(ContentType::from_str(&new_mime).unwrap())
|
||||
|
||||
request.headers.insert(
|
||||
header::CONTENT_TYPE,
|
||||
HeaderValue::from_str(&new_mime).unwrap(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue