Bug 1111834 - CORS request after preflight should not follow 30x redirect (r=sicking)

This commit is contained in:
Christoph Kerschbaumer 2015-02-19 13:43:40 -08:00
parent 94bc746272
commit 042c87324b

View File

@ -1217,6 +1217,12 @@ Navigator::SendBeacon(const nsAString& aUrl,
!contentType.Equals(APPLICATION_WWW_FORM_URLENCODED) &&
!contentType.Equals(MULTIPART_FORM_DATA) &&
!contentType.Equals(TEXT_PLAIN)) {
// we need to set the sameOriginChecker as a notificationCallback
// so we can tell the channel not to follow redirects
nsCOMPtr<nsIInterfaceRequestor> soc = nsContentUtils::SameOriginChecker();
channel->SetNotificationCallbacks(soc);
nsCOMPtr<nsIChannel> preflightChannel;
nsTArray<nsCString> unsafeHeaders;
unsafeHeaders.AppendElement(NS_LITERAL_CSTRING("Content-Type"));