fix(secure-headers): output standard empty parentheses () instead of none for disabled Permissions-Policy directives - #5197
Merged
Conversation
…f none for disabled directives
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5197 +/- ##
==========================================
- Coverage 79.69% 79.68% -0.01%
==========================================
Files 155 155
Lines 10892 10896 +4
Branches 2280 2282 +2
==========================================
+ Hits 8680 8683 +3
- Misses 2212 2213 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yusukebe
approved these changes
Aug 9, 2026
Contributor
Author
|
Thanks for reviewing and merging this, @yusukebe! Glad we could get the Permissions-Policy serialization aligned with the current specification. |
1 task
BlankParticle
pushed a commit
to BlankParticle/hono
that referenced
this pull request
Sep 6, 2026
…none for disabled Permissions-Policy directives (honojs#5197)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Historically, Hono's
secureHeadersmiddleware serialized disabled ornonevalue Permissions-Policy directives asnone(e.g.,camera=none). However, according to the modern W3C Structured Fields specification for thePermissions-Policyheader, thekeyword
noneis not a valid value. Instead, the correct syntax to disable a feature for all origins is an empty structured listrepresented by empty parentheses
().This PR updates the serialization in
getPermissionsPolicyDirectivesto correctly output()instead ofnonewhen a directivevalue is
falseor['none'], ensuring strict compliance with the standard and preventing modern browsers from failing to parsethe header.
The author should do the following, if applicable