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

Accept.encodings *;q=0 issue #75

Open
hoolam opened this issue Oct 16, 2024 · 1 comment
Open

Accept.encodings *;q=0 issue #75

hoolam opened this issue Oct 16, 2024 · 1 comment
Labels
bug Bug or defect

Comments

@hoolam
Copy link

hoolam commented Oct 16, 2024

Runtime

node.js

Runtime version

v20.18.0

Module version

@hapi/accept 6.0.3

Last module version without issue

No response

Used with

Standalone

Any other relevant information

No response

What are you trying to achieve or the steps to reproduce?

I am expecting the following code to produce [ 'compress' ] but instead it produces [ 'compress', 'identity' ], since I expect "*;q=0" to exclude "identity". Is my understanding correct?

const accept = require( "@hapi/accept" );
console.log( accept.encodings( "compress;q=0.5, *;q=0" ));

What was the result you got?

[ 'compress', 'identity' ]

What result did you expect?

[ 'compress' ]

@hoolam hoolam added the bug Bug or defect label Oct 16, 2024
@hoolam hoolam changed the title accept.encodings("compress;q=0.5, *;q=0") should not return "identity" Should accept.encodings("compress;q=0.5, *;q=0") return ["compress"] only or ["compress", "identity"]? Oct 16, 2024
kanongil added a commit to kanongil/accept that referenced this issue Oct 16, 2024
@kanongil kanongil changed the title Should accept.encodings("compress;q=0.5, *;q=0") return ["compress"] only or ["compress", "identity"]? Accept.encodings *;q=0 issue Oct 16, 2024
@kanongil
Copy link
Contributor

Thanks for the report. This is definitely a bug, which I have proposed a fix for in #76.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants