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

Simultaneous headers content-length and transfer-encoding leads to ParseError #7466

Closed
sbiemont opened this issue Oct 11, 2019 · 6 comments
Closed

Comments

@sbiemont
Copy link

bug
When both headers content-length and transfer-encoding are present, postman raises a ParseError and prints the message "Could not get any response".

example
transfer-encoding: chunked
content-length: 250

It's not coherent to have these 2 headers in a response (but they can be present).
If so, the content-length could be used first, without checking the transfer-encoding.
Or postman could raise a specific error. (?)

@vvs11
Copy link

vvs11 commented Oct 14, 2019

Hi @sbiemont, Thanks for writing in!
I tried sending a POST request with both the headers and its working for me.
Could you provide us with exact steps and screenshots of what you're trying to do?

@sbiemont
Copy link
Author

Hi @vvs11 !

More info:

  • I'm using a bearer token, in a GET request (it responses a 404 but the result is the same with a 200, I just have a lot more headers in the 200).
  • The root and the token are in variables.
  • Version: Postman-linux-x64-7.9.0 on Ubuntu

All present headers in the response:

  • transfer-encoding: chunked
  • Content-Type: application/json; charset=utf-8
  • Content-Length: 78
  • ETag: W/"4e-7EW8chmGrXO/dCnsUFYeNLttAp8"

I changed the settings as suggested in the postman error page (see screenshot) without any effect.

What postman prints ('Params' tab contains data but nothing is checked, and note that the message There was an error connecting to . is incomplete (the address is missing since postman 7.8.0)):
postman

What RESTer prints (firefox extension):
rester

@saswatds saswatds added this to Pending triage in Runtime Triage and Development via automation Oct 15, 2019
@vvs11 vvs11 added the bug label Mar 13, 2020
@verhyppo
Copy link

verhyppo commented Sep 9, 2020

Morning @codenirvana,
There are no updates on this issue?

@Mechanicalkeyboard
Copy link

@verhyppo @sbiemont After reproducing this, I am seeing an error returned that is more descriptive.

Closing this issue. If the behaviour seen in the most recent version is not up to your expectations, please re-open.
Screen Shot 2020-09-15 at 2 44 35 PM

Runtime Triage and Development automation moved this from Pending triage to Ready Sep 15, 2020
@MesaSantiago96
Copy link

@verhyppo @sbiemont After reproducing this, I am seeing an error returned that is more descriptive.

Closing this issue. If the behaviour seen in the most recent version is not up to your expectations, please re-open.
Screen Shot 2020-09-15 at 2 44 35 PM

I revive this issue because I can't find a solution to my problem.
That error you posted appears directly to me: Parse Error: The response headers can’t include “Content-Length” with chunked encoding.
And I understood that the description of the problem is very explanatory, but I can't understand what that means.
So my question is, what should I correct so that this error stops appearing, or at least, what should I look at to avoid it.

Phunky referenced this issue in john-doherty/express-request-transfer Feb 5, 2021
@sbiemont
Copy link
Author

Hi @MesaSantiago96

The new release of postman is very coherent and the response is now clear : both headers transfer-encoding and content-length, by definition, cannot be used at the same time.

The one and only solution is to have a consistent set of header with transfer-encoding or content-length (but not both).

An example of an answer on the same problem : chunked-encoding-and-content-length-header

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

No branches or pull requests

7 participants