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
NoMethodError when making request to an invoker-proxied task #130
Comments
This error happens when no |
That line was different from my installed version of invoker (the latest from rubygems, 1.3.2), so I tried re-installing invoker from the repo and got this error instead:
|
Invoker can't work if A client MUST include a Host header field in all HTTP/1.1 request messages . If the requested URI does not include an Internet host name for the service being requested, then the Host header field MUST be given with an empty value. An HTTP/1.1 proxy MUST ensure that any request message it forwards does contain an appropriate Host header field that identifies the service being requested by the proxy. All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html In other words, I think the node.js http client should be fixed to include |
On the flipside, I will update Invoker to return |
Great, thanks! The HTTP spec does allow for Host headers with an empty string value. I think that's what the request library is doing. If the Host header is not absolutely required to resolve the backend, it might make sense to handle empty string values without a 400 response. But it seems like it is. |
Fixed by #131 |
It would be hard to return non-400 response if Host header is empty from requests, because then Invoker can't decide which backend Invoker should proxy the request to. Theoretically, Invoker can be made to work via other ways, But as per HTTP specs it seems right thing to do is - always include a valid |
Yep, makes sense and that's what I'm doing for my use case. Just want to prevent others from getting caught up on this issue in the future. Thanks again. |
In my invoker.ini, I have an HTTP server. When making requests to it via the browser, everything works fine. When making requests via a node.js HTTP client, this happens:
Here's the node.js script used to make the request:
It uses this lib
The text was updated successfully, but these errors were encountered: