aohorodnyk / mimeheader

Library to work with MimeHeaders and other mime types. Library supports wildcards and parameters.
https://aohorodnyk.com/post/2021-07-03-mime-headers/
MIT License
24 stars 3 forks source link

Accept-Encoding support #12

Open Jille opened 8 months ago

Jille commented 8 months ago

Hi. Thanks for the library :)

Any plans for adding Accept-Encoding support? It currently doesn't work, I suspect because "gzip, br" doesn't contain slashes like mime-types.

aohorodnyk commented 6 months ago

@Jille Thank you for the ticket. Could you please describe the whole use case for that and I'll be happy to add it.

Jille commented 6 months ago

I want to know which encodings are supported by the client. A browser might send Accept-Encoding: gzip, br, older browsers would not include br and a more minimal implementation might not send any header at all.

Based on this I'd let the server pick the best available compression.

aohorodnyk commented 4 months ago

@Jille It looks similar, but it will require either adding new parser and type or significant refactoring with breaking API.

Do you have any suggestions how would you like to see the feature in the repo? Maybe you know some other similar headers that can be covered by a lib?