diff --git a/netwerk/protocol/http/OpaqueResponseUtils.cpp b/netwerk/protocol/http/OpaqueResponseUtils.cpp index 94969648a2c2..44fb272a115c 100644 --- a/netwerk/protocol/http/OpaqueResponseUtils.cpp +++ b/netwerk/protocol/http/OpaqueResponseUtils.cpp @@ -559,8 +559,7 @@ nsresult OpaqueResponseBlocker::ValidateJavaScript(HttpBaseChannel* aChannel, self->AllowResponse(); break; case OpaqueResponse::Block: - // We'll filter the data out later - self->AllowResponse(); + self->BlockResponse(channel, NS_ERROR_FAILURE); break; default: MOZ_ASSERT_UNREACHABLE( @@ -620,19 +619,11 @@ void OpaqueResponseBlocker::FilterResponse() { void OpaqueResponseBlocker::ResolveAndProcessData( HttpBaseChannel* aChannel, bool aAllowed, Maybe& aSharedData) { - if (!aAllowed) { - // OpaqueResponseFilter allows us to filter the headers - mNext = new OpaqueResponseFilter(mNext); - } - nsresult rv = OnStartRequest(aChannel); if (!aAllowed || NS_FAILED(rv)) { - MOZ_ASSERT_IF(!aAllowed, mState == State::Allowed); - // No need to call OnDataAvailable because - // 1. The input stream is consumed by - // OpaqueResponseBlocker::OnDataAvailable already - // 2. We don't want to pass any data over + MOZ_ASSERT_IF(!aAllowed, mState == State::Blocked); + // We decided to block, so nothing more to do. MaybeRunOnStopRequest(aChannel); return; } diff --git a/testing/web-platform/meta/fetch/orb/tentative/known-mime-type.sub.any.js.ini b/testing/web-platform/meta/fetch/orb/tentative/known-mime-type.sub.any.js.ini index 1502f4e6d2a9..bb9c7c8677dc 100644 --- a/testing/web-platform/meta/fetch/orb/tentative/known-mime-type.sub.any.js.ini +++ b/testing/web-platform/meta/fetch/orb/tentative/known-mime-type.sub.any.js.ini @@ -3,33 +3,18 @@ [ORB should block opaque font/ttf: fetch(..., {mode: "no-cors"})] expected: FAIL - [ORB should block opaque font/ttf: