cpp-httplib
cpp-httplib copied to clipboard
Configurable URL decoding of HTTP headers
Hi @yhirose
While parsing HTTP headers the library unconditionally applies an url decoding to all headers except for the Location header. https://github.com/yhirose/cpp-httplib/blob/master/httplib.h#L3809
In my specific use case there is a custom header that contains url-like data (server side). The decoding makes hardly possible the further processing of the data.
What do you thing about adding some flexibility to the function? Suggestions:
- global or server-level option to disable the url decoding;
- configurable set of headers that can be excluded from decoding.
@artpaul thank you for the report. This decoding was introduced at the following issue and commit.
https://github.com/yhirose/cpp-httplib/issues/576 https://github.com/yhirose/cpp-httplib/blame/852a37474892996c2a6968380f07eb0fe200f9fa/httplib.h
I am ok with "global or server-level option to disable the url decoding". If we take this option, are there any possible side effects that you can think of? Thanks!
I'll close it for now, since no response for a while.