httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
33.22k stars 3.67k forks source link

Duplicate Host headers when custom Host specified #235

Closed perbu closed 10 years ago

perbu commented 10 years ago

Version: 0.8.0-1 (ubuntu).

When overriding the HTTP Host header you'll end up with duplicate headers if the casing of the command line option isn't correct.

$ http -pHh http://localhost/cgi-bin/test.cgi host:www.foo.com
GET /cgi-bin/test.cgi HTTP/1.1
Accept: */*
Host: localhost
host: www.foo.com

If I specify Host:www.foo.com all is well. User-Agent seems to be handled correctly, so I guess there is some thought given to it.

PS: httpie is a great tool. I like it a lot.

jkbrzt commented 10 years ago

Thanks for the report. There should be a case-insensitive check somewhere instead.

perbu commented 10 years ago

Yeah. If I recall correctly all HTTP headers are case insensitive so the logic should be global, not just limited to user-agent.

On Wed, Jun 25, 2014 at 1:13 PM, Jakub Roztočil notifications@github.com wrote:

Thanks for the report. There should be a case-insensitive check somewhere instead.

— Reply to this email directly or view it on GitHub https://github.com/jakubroztocil/httpie/issues/235#issuecomment-47088210 .

http://www.varnish-software.com/ Per Buer CTO | Varnish Software Phone: +47 958 39 117 | Skype: per.buer We Make Websites Fly!

Winner of the Red Herring Top 100 Global Award 2013