Bug 378685 - Permission manager should operate on innermost URI, r=dveditz sr=mconnor

This commit is contained in:
dcamp%mozilla.com 2007-06-21 16:32:46 +00:00
Родитель 75606b94cf
Коммит 12d2d24b25
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -992,12 +992,15 @@ nsPermissionManager::Write()
nsresult
nsPermissionManager::GetHost(nsIURI *aURI, nsACString &aResult)
{
aURI->GetHost(aResult);
nsCOMPtr<nsIURI> innerURI = NS_GetInnermostURI(aURI);
if (!innerURI) return NS_ERROR_FAILURE;
innerURI->GetHost(aResult);
// If there is no host, use the scheme, and prepend "scheme:",
// to make sure it isn't a host or something.
if (aResult.IsEmpty()) {
aURI->GetScheme(aResult);
innerURI->GetScheme(aResult);
if (aResult.IsEmpty()) {
// still empty. Return error.
return NS_ERROR_FAILURE;