diff options
author | Pale Moon <git-repo@palemoon.org> | 2018-06-30 18:55:37 +0200 |
---|---|---|
committer | Pale Moon <git-repo@palemoon.org> | 2018-06-30 18:55:37 +0200 |
commit | 4a7f5bc0b06c6b4c5d3fa505b895bbfc66db12c6 (patch) | |
tree | 9ebb2eefc992e7eebe7bc719170d742ae70da623 | |
parent | 53606d9e9d107c5992b1b86932d30e9af7878b4c (diff) | |
download | palemoon-gre-4a7f5bc0b06c6b4c5d3fa505b895bbfc66db12c6.tar.gz |
Check redirect status code before forwarding to NPAPI.
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.
-rw-r--r-- | dom/plugins/base/nsPluginStreamListenerPeer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index 0ef5d4ddd..b37b3f280 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -1320,15 +1320,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) { @@ -1352,6 +1343,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)); |