Skip to content

Fix mulitple content length headers err #961

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

Closed
wants to merge 1 commit into from
Closed

Fix mulitple content length headers err #961

wants to merge 1 commit into from

Conversation

autoexpect
Copy link

No description provided.

@yhirose
Copy link
Owner

yhirose commented Jun 16, 2021

@umbrellary, could you provide a unit test case and explain the situation where this problem happens? Then, I'll review the pull request. Thanks!

@autoexpect
Copy link
Author

autoexpect commented Jun 17, 2021

@yhirose when Digest authentication is enabled, the problem in the picture below will occur when requesting POST(httplib::Result httplib::Client::Post(const char *path, size_t content_length, httplib::ContentProvider content_provider, const char *content_type)).
Thanks!
image

@yhirose
Copy link
Owner

yhirose commented Jun 20, 2021

@umbrellary, thank you for the update. Could you also provide lines in httplib.h where the first 'Connection: clone' and 'Content-Length: 3' are set? Thanks!

@autoexpect
Copy link
Author

My guess is that the client has already set it once when the server returns 401 for the first request, and it has been set again when the second request is made.
first:
image
second:
image

@yhirose
Copy link
Owner

yhirose commented Jun 21, 2021

@umbrellary, sorry but I still don't understand your comment... Could you provide the exact lines in httplib.h where the first 'Connection: close' and 'Content-Length: 3' are set as I requested in my previous comment? That information will tell me more insight about the problem.

@autoexpect
Copy link
Author

Sorry, I didn't answer clearly. The two positions are highlighted in the picture below.

'Connection: close'

001

'Content-Length: 3'

002

@yhirose yhirose closed this in 80be649 Jun 26, 2021
@yhirose
Copy link
Owner

yhirose commented Jun 26, 2021

@umbrellary, thanks for your contribution!

RealAbhishek pushed a commit to RealAbhishek/cpp-httplib that referenced this pull request Jul 2, 2021
ExclusiveOrange pushed a commit to ExclusiveOrange/cpp-httplib-exor that referenced this pull request May 2, 2023
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.

2 participants