diff --git a/mozilla/uriloader/prefetch/nsPrefetchService.cpp b/mozilla/uriloader/prefetch/nsPrefetchService.cpp index a299e987d12..ccd6262db0a 100644 --- a/mozilla/uriloader/prefetch/nsPrefetchService.cpp +++ b/mozilla/uriloader/prefetch/nsPrefetchService.cpp @@ -237,6 +237,14 @@ nsPrefetchListener::OnChannelRedirect(nsIChannel *aOldChannel, return NS_ERROR_ABORT; } + // HTTP request headers are not automatically forwarded to the new channel. + nsCOMPtr httpChannel = do_QueryInterface(aNewChannel); + NS_ENSURE_STATE(httpChannel); + + httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("X-Moz"), + NS_LITERAL_CSTRING("prefetch"), PR_FALSE); + + mService->UpdateCurrentChannel(aNewChannel); return NS_OK; } diff --git a/mozilla/uriloader/prefetch/nsPrefetchService.h b/mozilla/uriloader/prefetch/nsPrefetchService.h index 41e54fd9f11..956a3921521 100644 --- a/mozilla/uriloader/prefetch/nsPrefetchService.h +++ b/mozilla/uriloader/prefetch/nsPrefetchService.h @@ -73,6 +73,7 @@ public: nsresult Init(); void ProcessNextURI(); + void UpdateCurrentChannel(nsIChannel *c) { mCurrentChannel = c; } private: ~nsPrefetchService();