Bug 199768 document.referrer is empty

patch by keeda@hotpop.com r=sicking sr=peterv a=asa


git-svn-id: svn://10.0.0.236/trunk@140463 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
timeless%mozdev.org
2003-03-31 20:58:02 +00:00
parent 9a7aefcbbb
commit 066f57a5fe

View File

@@ -756,18 +756,23 @@ nsHTMLDocument::StartAutodetection(nsIDocShell *aDocShell, nsAString& aCharset,
nsresult
nsHTMLDocument::RetrieveRelevantHeaders(nsIChannel *aChannel)
{
nsAutoString lastModified;
mHttpChannel = do_QueryInterface(aChannel);
nsresult rv;
if (mHttpChannel) {
nsCAutoString lastModHeader;
nsCAutoString header;
rv = mHttpChannel->GetResponseHeader(NS_LITERAL_CSTRING("last-modified"),
lastModHeader);
header);
if (NS_SUCCEEDED(rv)) {
CopyASCIItoUCS2(lastModHeader, lastModified);
SetLastModified(lastModified);
SetLastModified(NS_ConvertASCIItoUCS2(header));
}
// The misspelled key 'referer' is as per the HTTP spec
rv = mHttpChannel->GetRequestHeader(NS_LITERAL_CSTRING("referer"),
header);
if (NS_SUCCEEDED(rv)) {
SetReferrer(NS_ConvertASCIItoUCS2(header));
}
}
@@ -782,6 +787,7 @@ nsHTMLDocument::RetrieveRelevantHeaders(nsIChannel *aChannel)
// file. Just don't set the last modified date on it...
rv = file->GetLastModifiedTime(&modDate);
if (NS_SUCCEEDED(rv)) {
nsAutoString lastModified;
PRExplodedTime prtime;
char buf[100];
PRInt64 intermediateValue;