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

feat(secureHeader): add CSP Report-Only mode support #3413

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

isoppp
Copy link
Contributor

@isoppp isoppp commented Sep 14, 2024

close #3412

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

Comment on lines +227 to +233
describe.each([
{ cspSettingName: 'contentSecurityPolicy', cspHeaderName: 'Content-Security-Policy' },
{
cspSettingName: 'contentSecurityPolicyReportOnly',
cspHeaderName: 'Content-Security-Policy-Report-Only',
},
])('CSP Setting ($cspSettingName)', ({ cspSettingName, cspHeaderName }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Diff is crazy... but the following just adds this loop and moves the X-powered-by test to the top.

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.78%. Comparing base (5f78e4e) to head (d75ca4a).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3413   +/-   ##
=======================================
  Coverage   95.77%   95.78%           
=======================================
  Files         154      154           
  Lines        9312     9322   +10     
  Branches     2730     2756   +26     
=======================================
+ Hits         8919     8929   +10     
  Misses        393      393           

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

@yusukebe
Copy link
Member

Hi @isoppp

Thank you for the PR!

@watany-dev Can you review this?

@watany-dev
Copy link
Contributor

Thank you, I think this option looks good. The implementation also seems promising.

@yusukebe
Copy link
Member

@watany-dev Thank you!

@isoppp Looks good! I'll merge this later. Since it's a small change, it may be included in the next patch release.

@isoppp isoppp changed the title feat(secureHeader): add Report-Only support feat(secureHeader): add CSP Report-Only mode support Sep 18, 2024
@yusukebe yusukebe merged commit 8130a67 into honojs:main Sep 24, 2024
14 checks passed
TinsFox pushed a commit to TinsFox/hono that referenced this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support CSP Report-Only mode
3 participants