Bug 1094257 - nsPrincipal::GetBaseDomain() should not use TLD if the protocol handler of the URI scheme has NORELATIVE flag, r=bz
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "nsIObjectInputStream.h"
|
||||
#include "nsIObjectOutputStream.h"
|
||||
#include "nsIClassInfoImpl.h"
|
||||
#include "nsIProtocolHandler.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "jswrapper.h"
|
||||
@@ -490,6 +491,18 @@ nsPrincipal::GetBaseDomain(nsACString& aBaseDomain)
|
||||
}
|
||||
}
|
||||
|
||||
bool hasNoRelativeFlag;
|
||||
nsresult rv = NS_URIChainHasFlags(mCodebase,
|
||||
nsIProtocolHandler::URI_NORELATIVE,
|
||||
&hasNoRelativeFlag);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (hasNoRelativeFlag) {
|
||||
return mCodebase->GetSpec(aBaseDomain);
|
||||
}
|
||||
|
||||
// For everything else, we ask the TLD service via
|
||||
// the ThirdPartyUtil.
|
||||
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
|
||||
|
||||
Reference in New Issue
Block a user