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

Getting "Error: Parse Error: Invalid header value char" In Postman #8747

Closed
arunasindhu19 opened this issue Jul 7, 2020 · 53 comments
Closed

Comments

@arunasindhu19
Copy link

Describe the bug
When I try to call a resource I am seeing "Error: Parse Error: Invalid header value char" in the Response.

To Reproduce
N/A

Expected behavior
I should be able to get a response back with 200 OK.

Screenshots

App information (please complete the following information):

  • Postman Version [e.g. 7.27.1]
  • OS: [e.g. Windows 64 bit]

Additional Information:
I am seeing this issue only with One QA Environment. And the rest of the environments it works fine without changing any values in the header.

Postman Issue

@reedbapex
Copy link

I am seeing this error also - starting with 7.27.1 - Win 64-bit.

FailedHeader7271

It works with previous version of Postman - making calls to same environment. I have tried 7.7.3 & 6.3.0 (auto upgraded to 6.7.? & still worked). A co-worker had 7.27.0 & that worked too, but as soon as they restarted & upgraded to 7.27.1 - it started failing. 7.27.1 is failing in 4 of our 6 environments. The console is no help as it won't display the pure raw response - just that there was a header parse failure. I cannot determine the failing character using CURL -i & looking for invalid data.

WorkingHeader773

@rodrigodesp
Copy link

A lot of people are having this problem where I work and here It´s blocked download old versions :S

@arunasindhu19
Copy link
Author

@reedbapex Thank You for the quick response. We have been breaking our heads over what was wrong. We went back to the previous versions and it works. 7.18.0 and 7.20.1 versions are currently working.

@arunasindhu19
Copy link
Author

@rodrigodesp That is frustrating. I hope your company does something about that :D

@SimonCigoj
Copy link

we have the same problem any news on this?

@sharedprophet
Copy link

sharedprophet commented Jul 10, 2020

I believe the issue is this: nodejs/node#27711

TL;DR new node response parser is very strict with regard to header validity and many services inject invalid headers intentionally, leading to these issues. Later Postman versions must have come with an upgraded underlying node version.

What we need from Postman is the ability to set the "insecure" override option on the http parser.

@mohitranka
Copy link

@arunasindhu19 and others, Can you share the reproduction steps to the issue?

@sharedprophet
Copy link

  1. Set up a server that will respond to a request with a header containing a newline, or other invalid character.
  2. Send a request to it via Postman.

@viananicolas
Copy link

viananicolas commented Jul 28, 2020

Creating a NODE_OPTIONS environment variable with the value --http-parser=legacy seems to have temporarily resolved this issue for me.

@reedbapex
Copy link

reedbapex commented Jul 29, 2020

The NODE_OPTIONS environment variable from viananicola temporary resolution works for me too.

EDIT - the NODE_OPTIONS environment variable set system wide broke MS Teams - it doesn't like having the --http-parser NODE_OPTIONS set. I had to set the environment variable when launching PostMan only.

@kkapell
Copy link

kkapell commented Sep 9, 2020

Can someone provide a little more details as to how to use this variable? Where to set it or how to reference it?

@reedbapex
Copy link

reedbapex commented Sep 9, 2020

It will depend on you operating system & recommend the following instructions.

Win10 - https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/
Mac - https://medium.com/@himanshuagarwal1395/setting-up-environment-variables-in-macos-sierra-f5978369b255
Linux - https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/

For win10 - to launch with environment variable just for Postman, I modified the shortcut properties used to launch...

C:\Windows\System32\cmd.exe /c "SET NODE_OPTIONS=--http-parser=legacy&C:\Users<user>\AppData\Local\Postman\Postman.exe"
I've also updated the 'Run' option to minimized.

@mdotson
Copy link

mdotson commented Sep 16, 2020

The NODE_OPTIONS environment variable from viananicola temporary resolution works for me too.

EDIT - the NODE_OPTIONS environment variable set system wide broke MS Teams - it doesn't like having the --http-parser NODE_OPTIONS set. I had to set the environment variable when launching PostMan only.

This worked for me. If you set this environment variable in your shell and then launch the app from that same shell, the issue is resolved. For example on mac:

This in your ~/.bash_profile or equivalent:
export NODE_OPTIONS="--http-parser=legacy"

Then you can launch postman like this (change path to wherever your postman is installed):
open /Applications/Postman.app

@mccannt
Copy link

mccannt commented Sep 18, 2020

Just wanted to drop a quick update here for everyone. We have this currently in our backlog to be resolved, thankfully it looks like we have the workaround listed above for those that are impacted by this.
We will let you know when we have any updates.

@Sasi-21
Copy link

Sasi-21 commented Nov 25, 2020

Hi All, I am also getting parse error. Is there any updates on this issue. As lots of people facing same issue.

image

@reedbapex
Copy link

There are relatively stable work-arounds listed above in the Jul-29 - Sept-16 comments. The Postman team has not addressed it as of 7.36.

@VaseemDeveloper
Copy link

Is there any update? If this issue is resolved for someone?
I have set the environment variable and restarted the Postman - Version 7.36.0 (7.36.0)
But this approach is not working.
printenv
NODE_OPTIONS=--http-parser=legacy

@uniquemag
Copy link

is there solution for this issue? Also encounter this on postman version 7.36.0
function was working 2 days ago, but no clue to see what's the problem now.

@Sasi-21
Copy link

Sasi-21 commented Dec 7, 2020

Hi All, setting environment variable approach working fine for me.
Just add following in the environment variables,

NODE_OPTIONS = --http-parser=legacy

image

@actongorton
Copy link

actongorton commented Dec 11, 2020

This issue came up. Turned out that the incoming response header from the api endpoint contained conflicting HTTP version declarations: HTTP/1.1 200 OK and HTTP/1.0 200. In my case, a custom response was being written into the initial response payload, and then a second version declaration was being written into the payload by the proxy. Removing the initial declaration and allowing the proxy to have its way solved the issue for me.

I was able to identify the problem by using curl with the verbose (-v) output to view and compare the responding headers against the expected headers.

@ramen-mukherjee
Copy link

I upgraded to Node v15.5.0 x64 today. With Postman v7.36.1 it started giving same issue.
I am on Windows 10 x64 and tried to set NODE_OPTIONS = --http-parser=legacy.
After setting this Postman doesn't start up.
Is there any other way to bypass this?

@reedbapex
Copy link

reedbapex commented Dec 31, 2020

My understanding is that above workaround doesn't work after Node 12. It's a node parser caused issue with some of the anti-DOS software solutions - or if the API is returning bad data in the headers.

@ramen-mukherjee
Copy link

@reedbapex : Is Postman Dependent on NodeJS ?

@mhartzell-incomm
Copy link

How in the WORLD has this not been addressed in over a year? What Postman replacement is out there with which I can invoke a basic GET request?

@cyopen1987
Copy link

How in the WORLD has this not been addressed in over a year? What Postman replacement is out there with which I can invoke a basic GET request?

@mhartzell-incomm as a chinese develper , I use postwoman instead, you can try , https://chrome.google.com/webstore/detail/postwoman-http%E6%8E%A5%E5%8F%A3%E8%B0%83%E8%AF%95%E6%8F%92%E4%BB%B6/ieoejemkppmjcdfbnfphhpbfmallhfnc
it 's a chrome plugin

@stdunbar
Copy link

v9.2.0 on Ubuntu with or without the NODE_OPTIONS setting is currently breaking the same way. For this example Postman is unusable and there is nothing output from Postman to indicate which header Postman considers invalid.

@RaymondMwaura
Copy link

In my case, saving newly entered environment variables then restarting Postman did the trick. Seems the "Save" feature has a bug.

@cattoa
Copy link

cattoa commented Dec 8, 2021

It seems that 9.3.1 on Windows is also not working with or without a NODE_OPTIONS settings in the environment variables

@PRRB
Copy link

PRRB commented Dec 15, 2021

I'm on Postman v9.5.0 and I'm running into the same issue since yesterday.

  • Only affects our dev environment, all others qa/uat etc. are fine.
  • It affects all requests to this domain.
  • I can make requests to this domain with Chrome without any problem.
  • NODE_OPTIONS environment variable workaround suggested above does not work.

It's crazy that this is still an issue which others were reporting over a year ago. I cannot even inspect the faulty headers in Postman, the only information is "There seems to be an invalid character in the response header value".

@ParrySMS
Copy link

ParrySMS commented Dec 31, 2021

Postman v9.7.1 meet the same issue. Finally I fix it by other way.

Attention: Do not set the NODE_OPTIONS in environment variable for system or postman.

If it not works for you, please remove it. Otherwise, it may cause your normal request to meet "Parse Error: There seems to be an invalid character in the response header value".

I fix it by disable some postman config. I am not sure which one have effect(maybe proxy). Here is my setting.

I turn on the "Send no-cache header", turn off the "SSL certificate verification" and off "Send Postman Token header" in the General tag.

I turn off the "CA certificates" in Certificates tag.

I click off the "Use the system proxy" in Proxy tag.

截屏2021-12-31 下午2 11 35

截屏2021-12-31 下午2 16 31

截屏2021-12-31 下午2 16 37

@ParrySMS
Copy link

I'm on Postman v9.5.0 and I'm running into the same issue since yesterday.

  • Only affects our dev environment, all others qa/uat etc. are fine.
  • It affects all requests to this domain.
  • I can make requests to this domain with Chrome without any problem.
  • NODE_OPTIONS environment variable workaround suggested above does not work.

It's crazy that this is still an issue which others were reporting over a year ago. I cannot even inspect the faulty headers in Postman, the only information is "There seems to be an invalid character in the response header value".

Please see my new comment. It maybe helpful.

@zfeed
Copy link

zfeed commented Feb 1, 2022

You can use insecureHTTPParser option to bypass it

See here

@postmanlabs postmanlabs deleted a comment from monzonj Feb 9, 2022
@shamseerahammedm
Copy link

shamseerahammedm commented Mar 9, 2022

this issue was reported at 7.27.1 now its 9.14.11 and still facing the same issue

@SimonCigoj
Copy link

same for me ... stil the same problem, I have not found a workaround

1 similar comment
@ErnandesAJr
Copy link

same for me ... stil the same problem, I have not found a workaround

@Bartmax
Copy link

Bartmax commented Jun 15, 2022

same here

@unclosable
Copy link

so which header is invalid exactly

@shanks25
Copy link

do we any update

@matisidler
Copy link

waiting for a solution :|

@MichaelHallik
Copy link

And here as well. :-(

@ghost
Copy link

ghost commented Sep 28, 2022

When using Imperva, the Issue was caused by a server classification cookie coontaining invalid characters for some HTTP parsers. Disabling this cookie solved the issue for me.

@bigfoot31
Copy link

This definitely is a problem & needs to be fixed. Otherwise Postman is proving useless for me. Here are the headers for which the above error is occurring.
Screenshot 2022-10-13 at 22 38 48

@wenlong139
Copy link

I meet this issue. But I think this issue is don'n releated postman.
I find when I curl an URL which response header has a key "C2vydmljzs1tzxnolw1hbmfnzxi=".
The head key contains a character '=' It is a special character and it's why postman analyze response invalid
So the reason may be your interface response a invalid response header key

@giridharvc7
Copy link

giridharvc7 commented Dec 15, 2022

Hello, we've fixed this issue with v10.6.x. Please update your app for these changes.
Thank you for your patience, please let us know if you face any issues.

@imhamzaaslam
Copy link

You are up to date!
Postman v10.6.7 is the latest version.
Last checked: December 23, 2022 at 6:00 PM

and still facing same issue. @giridharvc7

@giridharvc7
Copy link

@imhamzaaslam Can you share some more details on this?

@ankur586
Copy link

I have updated to v10.10.6 but still facing the same issue.

@ocierd
Copy link

ocierd commented May 6, 2023

I have the same issue; i can't resolve in postman, but when send the request by CURL, i see the error in the Strict-Transport_Security header. Any idea? Thanks!

image

@ismdcf
Copy link

ismdcf commented Jun 3, 2024

Hi Team,

Any update on this
My Reponse header has a weird response to it
Screenshot 2024-06-03 at 10 55 42 AM

Is there any possibility to disable the response header parsing on postman

My postman version is
Version 11.1.14
UI Version: 11.1.14-ui-240521-0853
Desktop Platform Version: 11.1.14 (11.1.14)

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

No branches or pull requests