mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1109751 - Request and Response constructors should set mime type. r=baku
This commit is contained in:
parent
833423e628
commit
e601432aec
@ -1627,15 +1627,15 @@ FetchBody<Response>::ConsumeBody(ConsumeType aType, ErrorResult& aRv);
|
||||
|
||||
template <class Derived>
|
||||
void
|
||||
FetchBody<Derived>::SetMimeType(ErrorResult& aRv)
|
||||
FetchBody<Derived>::SetMimeType()
|
||||
{
|
||||
// Extract mime type.
|
||||
ErrorResult result;
|
||||
nsTArray<nsCString> contentTypeValues;
|
||||
MOZ_ASSERT(DerivedClass()->GetInternalHeaders());
|
||||
DerivedClass()->GetInternalHeaders()->GetAll(NS_LITERAL_CSTRING("Content-Type"), contentTypeValues, aRv);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return;
|
||||
}
|
||||
DerivedClass()->GetInternalHeaders()->GetAll(NS_LITERAL_CSTRING("Content-Type"),
|
||||
contentTypeValues, result);
|
||||
MOZ_ALWAYS_TRUE(!result.Failed());
|
||||
|
||||
// HTTP ABNF states Content-Type may have only one value.
|
||||
// This is from the "parse a header value" of the fetch spec.
|
||||
@ -1647,10 +1647,10 @@ FetchBody<Derived>::SetMimeType(ErrorResult& aRv)
|
||||
|
||||
template
|
||||
void
|
||||
FetchBody<Request>::SetMimeType(ErrorResult& aRv);
|
||||
FetchBody<Request>::SetMimeType();
|
||||
|
||||
template
|
||||
void
|
||||
FetchBody<Response>::SetMimeType(ErrorResult& aRv);
|
||||
FetchBody<Response>::SetMimeType();
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -160,7 +160,7 @@ protected:
|
||||
virtual ~FetchBody();
|
||||
|
||||
void
|
||||
SetMimeType(ErrorResult& aRv);
|
||||
SetMimeType();
|
||||
private:
|
||||
enum ConsumeType
|
||||
{
|
||||
|
@ -34,6 +34,7 @@ Request::Request(nsIGlobalObject* aOwner, InternalRequest* aRequest)
|
||||
, mOwner(aOwner)
|
||||
, mRequest(aRequest)
|
||||
{
|
||||
SetMimeType();
|
||||
}
|
||||
|
||||
Request::~Request()
|
||||
@ -264,7 +265,7 @@ Request::Constructor(const GlobalObject& aGlobal,
|
||||
}
|
||||
|
||||
nsRefPtr<Request> domRequest = new Request(global, request);
|
||||
domRequest->SetMimeType(aRv);
|
||||
domRequest->SetMimeType();
|
||||
return domRequest.forget();
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ Response::Response(nsIGlobalObject* aGlobal, InternalResponse* aInternalResponse
|
||||
, mOwner(aGlobal)
|
||||
, mInternalResponse(aInternalResponse)
|
||||
{
|
||||
SetMimeType();
|
||||
}
|
||||
|
||||
Response::~Response()
|
||||
@ -188,7 +189,7 @@ Response::Constructor(const GlobalObject& aGlobal,
|
||||
}
|
||||
}
|
||||
|
||||
r->SetMimeType(aRv);
|
||||
r->SetMimeType();
|
||||
return r.forget();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user