From 4d0cf5fe488b7ab9db417e00d1665ca61ff3afee Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 28 Jan 2004 19:56:55 +0000 Subject: [PATCH] Don't do URI fixup on IP address literals. Bug 62402, patch by Lorenzo Colitti , r=adamlock, sr=darin git-svn-id: svn://10.0.0.236/trunk@151968 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index ef9c3a3fbae..1863ce6f553 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -121,6 +121,9 @@ #include "nsIExternalProtocolService.h" #include "nsCExternalHandlerService.h" +// Used in the fixup code +#include "prnetdb.h" + #ifdef NS_DEBUG /** * Note: the log module is created during initialization which @@ -860,6 +863,12 @@ nsresult nsWebShell::EndPageLoad(nsIWebProgress *aProgress, keywordsEnabled = PR_FALSE; } + // Don't perform fixup on an IP address + PRNetAddr addr; + if(PR_StringToNetAddr(host.get(), &addr) == PR_SUCCESS) { + keywordsEnabled = PR_FALSE; + } + if(keywordsEnabled && (-1 == dotLoc)) { // only send non-qualified hosts to the keyword server nsCAutoString keywordSpec("keyword:");