Bug 1312864 - Allow redirects for requests that require preflight. r?ckerschb
The Fetch Standard's editor confirms that the current version of the spec allows redirects for requests that require preflight [1].
[1] https://github.com/whatwg/fetch/commit/0d9a4db8bc02251cc9e391543bb3c1322fb882f2
MozReview-Commit-ID: 8bIYWP4KGj0
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp
+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp
@@ -1031,23 +1031,16 @@ nsCORSListenerProxy::CheckPreflightNeede
headers.AppendElement(NS_LITERAL_CSTRING("content-type"));
doPreflight = true;
}
if (!doPreflight) {
return NS_OK;
}
- // A preflight is needed. But if we've already been cross-site, then
- // we already did a preflight when that happened, and so we're not allowed
- // to do another preflight again.
- if (aUpdateType != UpdateType::InternalOrHSTSRedirect) {
- NS_ENSURE_FALSE(mHasBeenCrossSite, NS_ERROR_DOM_BAD_URI);
- }
-
nsCOMPtr<nsIHttpChannelInternal> internal = do_QueryInterface(http);
NS_ENSURE_TRUE(internal, NS_ERROR_DOM_BAD_URI);
internal->SetCorsPreflightParameters(
headers.IsEmpty() ? loadInfoHeaders : headers);
return NS_OK;
}