fixes bug 323852 "redirect after a prefetch does not include X-moz: prefetch header" r=biesi sr=bzbarsky
This commit is contained in:
Родитель
889e52cdc2
Коммит
e46fcd4c73
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче