[DOM] Ignore status 206 and vary header checking for opaque responses in the Cache API.

This commit is contained in:
Moonchild 2023-10-25 04:29:37 +02:00 committed by roytam1
commit fe37319996

View file

@ -190,7 +190,7 @@ TypeUtils::ToCacheResponseWithoutBody(CacheResponse& aOut,
aOut.statusText() = aIn.GetUnfilteredStatusText();
RefPtr<InternalHeaders> headers = aIn.UnfilteredHeaders();
MOZ_DIAGNOSTIC_ASSERT(headers);
if (HasVaryStar(headers)) {
if (aIn.Type() != ResponseType::Opaque && HasVaryStar(headers)) {
aRv.ThrowTypeError<MSG_RESPONSE_HAS_VARY_STAR>();
return;
}