Skip to content

fix: exclude default identity encoding when wildcard has q=0 - #80

Open
chiragbitoni wants to merge 1 commit into
hapijs:masterfrom
chiragbitoni:fix/wildcard-zero-encodings
Open

chiragbitoni wants to merge 1 commit into
hapijs:masterfrom
chiragbitoni:fix/wildcard-zero-encodings

Conversation

@chiragbitoni

Copy link
Copy Markdown

Fixes #75.

Description

Per RFC 7231 Section 5.3.4, when an Accept-Encoding header specifies *;q=0 (disallowing all unlisted encodings), identity is not acceptable unless explicitly listed with a positive qvalue. Previously, options.default ("identity") was always appended if identity was not in map, even when *;q=0 was present.

This change ensures that options.default is not added when a wildcard rule with q=0 is present, correctly yielding only explicitly permitted encodings.

Verification

  • 100% test pass (93/93 lab tests)
  • 100% code coverage maintained
  • 0 lint or type issues

Signed-off-by: Chirag Bitoni chiragbitoni4994@gmail.com

Fixes hapijs#75.

Signed-off-by: Chirag Bitoni <chiragbitoni4994@gmail.com>
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.

Accept.encodings *;q=0 issue

1 participant