mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 15:17:29 +09:00
Issue #1710 - Check for triggering principal URI in FTP subresource check.
Resolves #1710
This commit is contained in:
parent
24391cb707
commit
3caca43d30
1 changed files with 8 additions and 0 deletions
|
|
@ -149,8 +149,16 @@ nsContentSecurityManager::CheckFTPSubresourceLoad(nsIChannel* aChannel)
|
||||||
nsIPrincipal* triggeringPrincipal = loadInfo->TriggeringPrincipal();
|
nsIPrincipal* triggeringPrincipal = loadInfo->TriggeringPrincipal();
|
||||||
nsCOMPtr<nsIURI> tURI;
|
nsCOMPtr<nsIURI> tURI;
|
||||||
triggeringPrincipal->GetURI(getter_AddRefs(tURI));
|
triggeringPrincipal->GetURI(getter_AddRefs(tURI));
|
||||||
|
if (!tURI) {
|
||||||
|
// We don't have a triggering principal URI, meaning this isn't actually
|
||||||
|
// a subresource, but rather a top-level document, i.e. something we can
|
||||||
|
// display in-browser and might be saving as-is. Allow the load.
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
bool isTrigFtpURI = (NS_SUCCEEDED(tURI->SchemeIs("ftp", &isTrigFtpURI)) && isTrigFtpURI);
|
bool isTrigFtpURI = (NS_SUCCEEDED(tURI->SchemeIs("ftp", &isTrigFtpURI)) && isTrigFtpURI);
|
||||||
if (isTrigFtpURI) {
|
if (isTrigFtpURI) {
|
||||||
|
// The document loading this resource is also on FTP, satisfying the SOP.
|
||||||
|
// Allow the load.
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue