Bug 1207233 - Don't provide a default content-type header if user calls XHR.setRequestHeader('Content-Type', ''), r=jduell
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user