accept icon indicating copy to clipboard operation
accept copied to clipboard

Accept.encodings *;q=0 issue

Open hoolam opened this issue 1 year ago • 1 comments

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 avatar Oct 16 '24 05:10 hoolam

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

kanongil avatar Oct 16 '24 11:10 kanongil