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

Already on GitHub? Sign in to your account

Content-Length not updated between request #58

Closed
gabrielf opened this Issue Nov 23, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

gabrielf commented Nov 23, 2012

It seems the Content Length for requests are set to the same value between requests. This makes requests fail when sending subsequent requests with more data if the server respects the Content-Length since the input will be truncated.

Example

First request

POST / HTTP/1.1
Content-Length: 12
Content-Type: application/x-www-form-urlencoded
Host: localhost:3001
Connection: keep-alive

param=short

Second request

POST / HTTP/1.1
Content-Length: 12        <=== Still 12! Should be 14 since param is now longer
Content-Type: application/x-www-form-urlencoded
Host: localhost:3001
Connection: keep-alive

param=longer
Contributor

gabrielf commented Nov 23, 2012

This issue is fixed by pull request 59 but for some reason I cannot paste the link since github is converting it to a link to issue 59 instead of pull request 59...

@mansilladev mansilladev added a commit that referenced this issue Mar 28, 2014

@mansilladev mansilladev Merge pull request #59 from gabrielf/issue-58
Issue #58 fixed. Using clone on options.headers.
32f74c1
Contributor

phairow commented Oct 10, 2014

closing since this was fixed in #59

@phairow phairow closed this Oct 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment