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

Remove newline when writing http post/put data #560

Merged
merged 1 commit into from
Jul 29, 2020
Merged

Remove newline when writing http post/put data #560

merged 1 commit into from
Jul 29, 2020

Conversation

zentrope
Copy link
Contributor

When writing post data, adding an extra newline may cause some
web servers to close the connection before sending a response
because the extra newline isn’t accounted for in the post/put data’s
content length. Removing the newline seems to fix the problem. This was
encountered posting a capabilities document to chromedriver’s
/session endpoint. An alternate fix is to include the new line in the
content-length calculation.

When writing post data, adding an extra newline may cause some
web servers to close the connection before sending a response
because the extra newline isn’t accounted for in the post/put data’s
content length. Removing the newline seems to fix the problem. This was
encountered posting a capabilities document to `chromedriver`’s
/session endpoint. An alternate fix is to include the new line in the
content-length calculation.
Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
This was quite the debugging trip.

@vyzo vyzo merged commit 660429e into mighty-gerbils:master Jul 29, 2020
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