Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable URL decoding of HTTP headers #1789

Open
artpaul opened this issue Mar 4, 2024 · 1 comment
Open

Configurable URL decoding of HTTP headers #1789

artpaul opened this issue Mar 4, 2024 · 1 comment

Comments

@artpaul
Copy link
Contributor

artpaul commented Mar 4, 2024

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.
@yhirose
Copy link
Owner

yhirose commented Mar 5, 2024

@artpaul thank you for the report. This decoding was introduced at the following issue and commit.

#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!

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

No branches or pull requests

2 participants