Bug 94514 - POST result page should not appear in global history or history autocomplete results. r=bz, sr=bz

git-svn-id: svn://10.0.0.236/trunk@245011 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sdwilsh%shawnwilsher.com
2008-02-06 18:18:07 +00:00
parent d110a8e43e
commit 55ee92803d
4 changed files with 106 additions and 0 deletions

View File

@@ -8612,6 +8612,16 @@ nsDocShell::AddToGlobalHistory(nsIURI * aURI, PRBool aRedirect,
if (mItemType != typeContent || !mGlobalHistory)
return NS_OK;
// If this is a POST request, we do not want to include this in global
// history, so return early.
nsCOMPtr<nsIHttpChannel> hchan(do_QueryInterface(aChannel));
if (hchan) {
nsCAutoString type;
nsresult rv = hchan->GetRequestMethod(type);
if (NS_SUCCEEDED(rv) && type.EqualsLiteral("POST"))
return NS_OK;
}
PRBool visited;
nsresult rv = mGlobalHistory->IsVisited(aURI, &visited);
if (NS_FAILED(rv))