Skip to content

Refactor HTTP Accept-Encoding header parsing#542

Draft
Woazboat wants to merge 3 commits intozerebubuth:masterfrom
Woazboat:bugfix/540-accept-encoding-delimiter
Draft

Refactor HTTP Accept-Encoding header parsing#542
Woazboat wants to merge 3 commits intozerebubuth:masterfrom
Woazboat:bugfix/540-accept-encoding-delimiter

Conversation

@Woazboat
Copy link
Contributor

@Woazboat Woazboat commented Mar 6, 2026

Implement a generic HTTP list header parser and use it to replace the current Accept-Encoding header parsing.

Properly handle optional whitespace in list items/parameters. Prioritize encodings in order requested by user (#540 (comment)).

Change encoding classes to singletons since they are only used as factories and don't hold any state.


Requires GCC version 12 to make std::ranges::views::split actually usable

GCC 12 is available in Ubuntu 22.04 used in CI, but GCC 11 is still used as the default

(GCC 12 is also required for constexpr std::string/std::vector, but those aren't really necessary.)

https://en.cppreference.com/w/cpp/20.html


Fixes #540

Woazboat added 3 commits March 5, 2026 23:26
Prioritize encodings in order sent by client

'identity' encoding is always valid unless explicitly forbidden

Fixes zerebubuth#540
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-Encoding is not parsed correctly

1 participant