diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 88c669586c5..d26ac8edbec 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -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 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)) diff --git a/mozilla/docshell/test/Makefile.in b/mozilla/docshell/test/Makefile.in index c4fbb9b6f8b..dcc9b844ebf 100644 --- a/mozilla/docshell/test/Makefile.in +++ b/mozilla/docshell/test/Makefile.in @@ -54,6 +54,8 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk _TEST_FILES = \ + test_bug94514.html \ + bug94514-postpage.html \ test_bug344861.html \ test_bug369814.html \ bug369814.zip \ diff --git a/mozilla/docshell/test/bug94514-postpage.html b/mozilla/docshell/test/bug94514-postpage.html new file mode 100644 index 00000000000..cbbaf638a35 --- /dev/null +++ b/mozilla/docshell/test/bug94514-postpage.html @@ -0,0 +1,30 @@ + + + + + Test Page for Bug 94515 + + + +
+ +
+ + + + diff --git a/mozilla/docshell/test/test_bug94514.html b/mozilla/docshell/test/test_bug94514.html new file mode 100644 index 00000000000..250a859b822 --- /dev/null +++ b/mozilla/docshell/test/test_bug94514.html @@ -0,0 +1,64 @@ + + + + + Test for Bug 94515 + + + + + + +Mozilla Bug 94514 + + +
+
+
+ +