зеркало из https://github.com/mozilla/pjs.git
Bug 378685 - Permission manager should operate on innermost URI, r=dveditz sr=mconnor
This commit is contained in:
Родитель
75606b94cf
Коммит
12d2d24b25
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче