diff options
author | Kyle Machulis <kyle@nonpolynomial.com> | 2018-04-30 12:49:15 -0700 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-30 18:53:05 +0200 |
commit | bb89f847383c982f25497a31f94129bf65e50868 (patch) | |
tree | 159d83ae1215144f444c81535a6e0f66ef9c719e /dom | |
parent | 67d4d2fe185849e8c19c2045ad83e1d528d44cec (diff) | |
download | UXP-bb89f847383c982f25497a31f94129bf65e50868.tar UXP-bb89f847383c982f25497a31f94129bf65e50868.tar.gz UXP-bb89f847383c982f25497a31f94129bf65e50868.tar.lz UXP-bb89f847383c982f25497a31f94129bf65e50868.tar.xz UXP-bb89f847383c982f25497a31f94129bf65e50868.zip |
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.
Diffstat (limited to 'dom')
-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 26e0318e3..665e11ec1 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -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)); |