Bug 393002 - ""Server not found" message for view-source window doesn't display server name" [p=anant@kix.in (Anant Narayanan) r=bsmedberg sr=bzbarsky a1.9=damons]
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -2947,17 +2947,18 @@ nsDocShell::DisplayLoadError(nsresult aE
rv = NS_OK;
formatStrCount = 1;
error.AssignLiteral("fileNotFound");
}
else if (NS_ERROR_UNKNOWN_HOST == aError) {
NS_ENSURE_ARG_POINTER(aURI);
// Get the host
nsCAutoString host;
- aURI->GetHost(host);
+ nsCOMPtr<nsIURI> innermostURI = NS_GetInnermostURI(aURI);
+ innermostURI->GetHost(host);
CopyUTF8toUTF16(host, formatStrs[0]);
formatStrCount = 1;
error.AssignLiteral("dnsNotFound");
}
else if(NS_ERROR_CONNECTION_REFUSED == aError) {
NS_ENSURE_ARG_POINTER(aURI);
// Build up the host:port string.
nsCAutoString hostport;