-
Notifications
You must be signed in to change notification settings - Fork 384
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
Honor Host header when connecting to IPs #96
Conversation
I wonder if this is a bridge too far, the feature is quite esoteric, and its usage is even more so. I'm leaning towards saying No to this one. |
Let's try this again after getting some sleep. 😉 |
@davecheney at work I'm often doing testing against singular IPs, while passing in a
I'd replace my usage with |
@@ -23,6 +23,7 @@ script: | |||
- ./httpstat -X DELETE http://httpbin.org/delete | |||
- ./httpstat https://www.google.com/ | |||
- ./httpstat https://www.google.com:443/ | |||
- ./httpstat -H "Host: www.google.com" https://$(dig +short www.google.com):443/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a bit more resistant to failure? If Google ever adds multiple A records this test will fail. How do you feel about dig +short www.google.com | head -n 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, but it turns how that I can't use dig
in Travis anyway. If anyone has any better ideas, let me know. Pushed a hard-coded test for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nevermind...
$ {:"./httpstat -H \"Host"=>"www.google.com\" https://$(dig +short www.google.com):443/"}
/home/travis/build.sh: line 45: dig: command not found
/home/travis/build.sh: line 45: dig: command not found
/home/travis/build.sh: line 45: www.google.com" https://:443/}: No such file or directory
😂
@moorereason maybe we can add this to the top of the
You should then have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer to use dig
over the hard-coded IPv4 address. However, I don't feel strongly enough to block it (easy enough to open a separate PR to enhance the Travis testing).
@theckman, thanks for the addons info. Fixed. 👍 |
Fixes #36