mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Bug 1436241 - Check redirect status code before forwarding to NPAPI. r=jimm, r=pauljt, a=jcristau
NPAPI may handle a 307 redirect across different origins, while they should only happen on same origin requests. Have the browser check this before forwarding to NPAPI.
This commit is contained in:
parent
393973a1f5
commit
152f93be21
1 changed files with 9 additions and 9 deletions
|
|
@ -1381,15 +1381,6 @@ nsPluginStreamListenerPeer::AsyncOnChannelRedirect(nsIChannel *oldChannel, nsICh
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAsyncVerifyRedirectCallback> proxyCallback =
|
||||
new ChannelRedirectProxyCallback(this, callback, oldChannel, newChannel);
|
||||
|
||||
// Give NPAPI a chance to control redirects.
|
||||
bool notificationHandled = mPStreamListener->HandleRedirectNotification(oldChannel, newChannel, proxyCallback);
|
||||
if (notificationHandled) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Don't allow cross-origin 307 POST redirects.
|
||||
nsCOMPtr<nsIHttpChannel> oldHttpChannel(do_QueryInterface(oldChannel));
|
||||
if (oldHttpChannel) {
|
||||
|
|
@ -1413,6 +1404,15 @@ nsPluginStreamListenerPeer::AsyncOnChannelRedirect(nsIChannel *oldChannel, nsICh
|
|||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAsyncVerifyRedirectCallback> proxyCallback =
|
||||
new ChannelRedirectProxyCallback(this, callback, oldChannel, newChannel);
|
||||
|
||||
// Give NPAPI a chance to control redirects.
|
||||
bool notificationHandled = mPStreamListener->HandleRedirectNotification(oldChannel, newChannel, proxyCallback);
|
||||
if (notificationHandled) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Fall back to channel event sink for window.
|
||||
nsCOMPtr<nsIChannelEventSink> channelEventSink;
|
||||
nsresult rv = GetInterfaceGlobal(NS_GET_IID(nsIChannelEventSink), getter_AddRefs(channelEventSink));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue