accept
accept copied to clipboard
Accept.encodings *;q=0 issue
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' ]
Thanks for the report. This is definitely a bug, which I have proposed a fix for in #76.