fixes bug 323852 "redirect after a prefetch does not include X-moz: prefetch header" r=biesi sr=bzbarsky a=dveditz
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_0_BRANCH@191059 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -237,6 +237,14 @@ nsPrefetchListener::OnChannelRedirect(nsIChannel *aOldChannel,
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
// HTTP request headers are not automatically forwarded to the new channel.
|
||||
nsCOMPtr<nsIHttpChannel> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ public:
|
||||
|
||||
nsresult Init();
|
||||
void ProcessNextURI();
|
||||
void UpdateCurrentChannel(nsIChannel *c) { mCurrentChannel = c; }
|
||||
|
||||
private:
|
||||
~nsPrefetchService();
|
||||
|
||||
Reference in New Issue
Block a user