Backed out changeset f525479fabd6 (bug 1454325) for xpcshell/test_Http.js failures CLOSED TREE
This commit is contained in:
@@ -2776,19 +2776,16 @@ nsresult XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody,
|
||||
uploadContentType = defaultContentType;
|
||||
} else if (aBodyIsDocumentOrString &&
|
||||
StaticPrefs::dom_xhr_standard_content_type_normalization()) {
|
||||
UniquePtr<CMimeType> contentTypeRecord =
|
||||
CMimeType::Parse(uploadContentType);
|
||||
nsAutoCString charset;
|
||||
if (contentTypeRecord &&
|
||||
contentTypeRecord->GetParameterValue(kLiteralString_charset,
|
||||
charset) &&
|
||||
!charset.EqualsIgnoreCase("utf-8")) {
|
||||
contentTypeRecord->SetParameterValue(kLiteralString_charset,
|
||||
kLiteralString_UTF_8);
|
||||
contentTypeRecord->Serialize(uploadContentType);
|
||||
UniquePtr<CMimeType> parsed = CMimeType::Parse(uploadContentType);
|
||||
if (parsed && parsed->HasParameter(kLiteralString_charset)) {
|
||||
parsed->SetParameterValue(kLiteralString_charset,
|
||||
kLiteralString_UTF_8);
|
||||
parsed->Serialize(uploadContentType);
|
||||
}
|
||||
} else if (!charset.IsEmpty()) {
|
||||
// We don't want to set a charset for streams.
|
||||
}
|
||||
|
||||
// We don't want to set a charset for streams.
|
||||
if (!charset.IsEmpty()) {
|
||||
// Replace all case-insensitive matches of the charset in the
|
||||
// content-type with the correct case.
|
||||
RequestHeaders::CharsetIterator iter(uploadContentType);
|
||||
|
||||
Reference in New Issue
Block a user