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

req.headers.host do not include port number when using q-io('http') #77

Closed
CakeSpork opened this issue Jan 13, 2014 · 2 comments
Closed
Assignees

Comments

@CakeSpork
Copy link

Hey guys,

I have a problem with q-io/http as I'm sending new request within the requested resource but req.headers.host turns out to be 'localhost' within it instead of 'localhost|:3000'. The request does actually get sent to the correct URL, but the Express request object does not contain the correct headers when it ends up there.

For reference, the behavior does work as expected with require('request'). So I'm switching there for now, if I can not find a fix myself.

@CakeSpork
Copy link
Author

I've traced the problem to http.js in this line:
request.headers.host = url.hostname; // FIXME name consistency

Seems... there were already people aware before this issue bothered me. Any reason that request.headers.host is not url.host?

CakeSpork pushed a commit to CakeSpork/q-io that referenced this issue Jan 13, 2014
…ed to http.request and headers.host is now the host, not hostname.

Background info:
- hostname: To support url.parse() hostname is preferred over host. Source: http://nodejs.org/api/http.html#http_http_request_options_callback
- host should include port number. Source: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23
@kriskowal
Copy link
Owner

We have fixed this problem in the latest v1 and v2 releases. My apologies for the delay.

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

Successfully merging a pull request may close this issue.

2 participants