mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1207233 - Don't provide a default content-type header if user calls XHR.setRequestHeader('Content-Type', ''), r=jduell
This commit is contained in:
parent
7a39dd4823
commit
666b312bae
@ -2700,8 +2700,7 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable<RequestBody>& aBody)
|
||||
nsAutoCString contentType;
|
||||
if (NS_FAILED(httpChannel->
|
||||
GetRequestHeader(NS_LITERAL_CSTRING("Content-Type"),
|
||||
contentType)) ||
|
||||
contentType.IsEmpty()) {
|
||||
contentType))) {
|
||||
contentType = defaultContentType;
|
||||
|
||||
if (!charset.IsEmpty()) {
|
||||
|
@ -721,8 +721,13 @@ HttpBaseChannel::ExplicitSetUploadStream(nsIInputStream *aStream,
|
||||
contentLengthStr.AppendInt(aContentLength);
|
||||
SetRequestHeader(NS_LITERAL_CSTRING("Content-Length"), contentLengthStr,
|
||||
false);
|
||||
SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), aContentType,
|
||||
false);
|
||||
|
||||
if (aContentType.IsEmpty()) {
|
||||
SetEmptyRequestHeader(NS_LITERAL_CSTRING("Content-Type"));
|
||||
} else {
|
||||
SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"), aContentType,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
mUploadStreamHasHeaders = aStreamHasHeaders;
|
||||
|
@ -1,5 +0,0 @@
|
||||
[setrequestheader-content-type.htm]
|
||||
type: testharness
|
||||
[XMLHttpRequest: setRequestHeader() - Content-Type header ()]
|
||||
expected: FAIL
|
||||
|
Loading…
Reference in New Issue
Block a user