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:
darin%meer.net
2006-02-23 19:39:51 +00:00
parent 2d1b5fa723
commit 5d8a844d1c
2 changed files with 9 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -73,6 +73,7 @@ public:
nsresult Init();
void ProcessNextURI();
void UpdateCurrentChannel(nsIChannel *c) { mCurrentChannel = c; }
private:
~nsPrefetchService();