mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 17:47:34 +09:00
Issue #2402 - Ignore empty CSP directives. https://bugzilla.mozilla.org/show_bug.cgi?id=1439425
This commit is contained in:
parent
90eb83819c
commit
bfabbcd311
3 changed files with 12 additions and 0 deletions
|
|
@ -1115,6 +1115,10 @@ nsCSPParser::directive()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CSP_IsEmptyDirective(mCurValue, mCurToken)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Try to create a new CSPDirective
|
// Try to create a new CSPDirective
|
||||||
nsCSPDirective* cspDir = directiveName();
|
nsCSPDirective* cspDir = directiveName();
|
||||||
if (!cspDir) {
|
if (!cspDir) {
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,13 @@ CSP_CreateHostSrcFromSelfURI(nsIURI* aSelfURI)
|
||||||
return hostsrc;
|
return hostsrc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CSP_IsEmptyDirective(const nsAString& aValue, const nsAString& aDir)
|
||||||
|
{
|
||||||
|
return (aDir.Length() == 0 &&
|
||||||
|
aValue.Length() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CSP_IsValidDirective(const nsAString& aDir)
|
CSP_IsValidDirective(const nsAString& aDir)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,7 @@ nsresult CSP_AppendCSPFromHeader(nsIContentSecurityPolicy* aCsp,
|
||||||
class nsCSPHostSrc;
|
class nsCSPHostSrc;
|
||||||
|
|
||||||
nsCSPHostSrc* CSP_CreateHostSrcFromSelfURI(nsIURI* aSelfURI);
|
nsCSPHostSrc* CSP_CreateHostSrcFromSelfURI(nsIURI* aSelfURI);
|
||||||
|
bool CSP_IsEmptyDirective(const nsAString& aValue, const nsAString& aDir);
|
||||||
bool CSP_IsValidDirective(const nsAString& aDir);
|
bool CSP_IsValidDirective(const nsAString& aDir);
|
||||||
bool CSP_IsDirective(const nsAString& aValue, CSPDirective aDir);
|
bool CSP_IsDirective(const nsAString& aValue, CSPDirective aDir);
|
||||||
bool CSP_IsKeyword(const nsAString& aValue, enum CSPKeyword aKey);
|
bool CSP_IsKeyword(const nsAString& aValue, enum CSPKeyword aKey);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue