mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 06:18:38 +09:00
Issue #1442 - Part 10a - Unify body extraction in Fetch/Beacon/XHR. https://bugzilla.mozilla.org/show_bug.cgi?id=1329298 Pre-requisite for Part 11.
This commit is contained in:
parent
3979e4847c
commit
a4146b60a4
15 changed files with 439 additions and 447 deletions
|
|
@ -580,11 +580,11 @@ Request::Constructor(const GlobalObject& aGlobal,
|
|||
const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& bodyInit =
|
||||
bodyInitNullable.Value();
|
||||
nsCOMPtr<nsIInputStream> stream;
|
||||
nsAutoCString contentType;
|
||||
nsAutoCString contentTypeWithCharset;
|
||||
uint64_t contentLengthUnused;
|
||||
aRv = ExtractByteStreamFromBody(bodyInit,
|
||||
getter_AddRefs(stream),
|
||||
contentType,
|
||||
contentTypeWithCharset,
|
||||
contentLengthUnused);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return nullptr;
|
||||
|
|
@ -592,10 +592,10 @@ Request::Constructor(const GlobalObject& aGlobal,
|
|||
|
||||
temporaryBody = stream;
|
||||
|
||||
if (!contentType.IsVoid() &&
|
||||
if (!contentTypeWithCharset.IsVoid() &&
|
||||
!requestHeaders->Has(NS_LITERAL_CSTRING("Content-Type"), aRv)) {
|
||||
requestHeaders->Append(NS_LITERAL_CSTRING("Content-Type"),
|
||||
contentType, aRv);
|
||||
contentTypeWithCharset, aRv);
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue