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

Bad "Host" header if using request params #2276

Closed
narqo opened this issue Aug 19, 2016 · 4 comments
Closed

Bad "Host" header if using request params #2276

narqo opened this issue Aug 19, 2016 · 4 comments
Assignees

Comments

@narqo
Copy link

narqo commented Aug 19, 2016

  1. Postman Version: 4.6.2
  2. App (Chrome app or Mac app): Mac app
  3. OS details: MacOS 10.11
  4. Is the Interceptor on and enabled in the app: -
  5. Did you encounter this recently, or has this bug always been there: the appears since 4.6.0
  6. Expected behaviour: Host mustn't contain protocol part
  7. Console logs (http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/ for the Chrome App, View->Toggle Dev Tools for the Mac app):

GET https://api.my.dev.host.yandex.ru/1.0/regions/1

Request Headers:
User-Agent:"PostmanRuntime/2.4.2"
Accept:"*/*"
Host:"https://api.my.dev.host.yandex.ru"
accept-encoding:"gzip, deflate"
Response Headers:
Server:"nginx"
Date:"Fri, 19 Aug 2016 11:54:50 GMT"
Content-Type:"text/html"
Content-Length:"166"
Connection:"close"
Set-Cookie:"uid=VMmjxle284o8gRemAwMEAg==; path=/"

Response Body:

When both {{param}} and :param params present in the request, Postman breaks Host request header, adding a protocol part. I believe the bug was introduced in version 4.6.0.

For example, my Postman request looks like

GET {{api_host}}/1.0/regions/:rid
  • {{api_host}} is my environment variable, which contains API's base URL, e.g. http://api.my.dev.host.yandex.ru
  • :rid is a local request URL parameter

In this case, PostMan sends bad host header: Host:"https://api.my.dev.host.yandex.ru", but if I remove :rid, and hardcode the parameter, the header is sent properly, e.g. Host:"api.my.dev.host.yandex.ru".

@narqo
Copy link
Author

narqo commented Aug 19, 2016

In addition to what've been said, I can't reproduce the bug if request goes to localhost.

@shamasis
Copy link
Member

Okay. We're on it. Without testing it, from a birds eye view, seems like a conflict in variable parsing. Will look in deeper and update the issue.

Cc @numaanashraf @czardoz @madebysid

@numaanashraf
Copy link
Member

@narqo This should be fixed in versions 4.6.3 and up. Could you verify and let us know if you are still facing issues?

@narqo
Copy link
Author

narqo commented Sep 7, 2016

I've checked with 4.7.0 and looks like my problem had been solved. Thanks!

@narqo narqo closed this as completed Sep 7, 2016
@abhijitkane abhijitkane removed the bug label Sep 7, 2016
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

No branches or pull requests

5 participants