Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent errors when non-string CSP values are defined in the manifest #5195

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

willdurand
Copy link
Member

@willdurand willdurand commented Feb 12, 2024

Fixes #5194

┆Issue is synchronized with this Jira Task

@willdurand willdurand requested a review from rpl February 12, 2024 09:26
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1cdb761) 98.74% compared to head (6a68605) 98.74%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5195   +/-   ##
=======================================
  Coverage   98.74%   98.74%           
=======================================
  Files          54       54           
  Lines        2937     2940    +3     
  Branches      896      898    +2     
=======================================
+ Hits         2900     2903    +3     
  Misses         37       37           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@rpl rpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willdurand the fix looks reasonable as is, the inline comments are related to a small addition to the test case and considering not validating the csp strings at all if the value of the content_security_policy field is an array (mainly to avoid to validate values that would be in an invalid form anyway).

tests/unit/parsers/test.manifestjson.js Outdated Show resolved Hide resolved
src/parsers/manifestjson.js Show resolved Hide resolved
@willdurand willdurand merged commit 9732463 into master Feb 12, 2024
5 checks passed
@willdurand willdurand deleted the fix-csp branch February 12, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: policy.toLowerCase is not a function
2 participants