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

Request Header content-length in lower first case makes server ignore requests! #6

Open
GitMAGI opened this issue Aug 20, 2019 · 0 comments

Comments

@GitMAGI
Copy link

GitMAGI commented Aug 20, 2019

The Content-Length Header in Requests must be UpperFirst-ed.
content-length will make the server parse an empty request body.
Content-Length in upper first, will work correctly.
The problem is that if you are using tools like Postman, the header regarding the length of the body, is automatically written by the tool (in my case Postman writes it in lower case).
I fixed it editing my local file httplib.h at line 511, in this way

auto len = get_header_value_int(x.headers, "Content-Length", 0);
if(!len)
    len = get_header_value_int(x.headers, "content-length", 0);
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

1 participant