postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.88k stars 1.17k forks source link

newman custom http header #2616

Open impnguyen opened 3 years ago

impnguyen commented 3 years ago

Hi,

I tried to execute an exported postman collection in the newman cli. Basically they behaviour differently. In the Postman Gui I can fetch an http x-csrf-token. In the I also can see the fetched token.

The same exported collection does not work in newman cli (in my docker container). If I log the "pm.response.headers" and "pm.request.headers" in postman. I can see the value "Fetched" and the token inside of the response. The same request on newman only shows the http header (not system) with value "fetch". But the response does not contain a value.

Do I have to enable custom http header? I could not found any information about white listing for custom http header in newman environment.

  1. Newman Version (can be found via newman -v): 5.2.2
  2. OS details (type, version, and architecture): Ubuntu 18.04
  3. Are you using Newman as a library, or via the CLI? via CLI in docker container for gitlab ci/cd
  4. Did you encounter this recently, or has this bug always been there: recently
  5. Expected behaviour: same behaviour in newman like in postman
  6. Command / script used to run Newman: newman run "./Postman_Collections/newman_api_collection.json" --verbose --bail --color on -r html,cli -k --delay-request 500 -e "./Postman_Environments/....json" --env-var "ceoUsername=${user}" --env-var "ceoPassword=${pwd}" --env-var "apimApiKey=${apikey}"
  7. Sample collection, and auxiliary files (minus the sensitive details):
  8. Screenshots (if applicable):
adityaofficial10 commented 3 years ago

@impnguyen I'm trying to reproduce this and I'll try to come up with a fix soon.

impnguyen commented 3 years ago

@adityaofficial10 Do you have news for this issue?