Permalink
Browse files

Remove port from Host: header when port == 80 (eventmachine#193)

  • Loading branch information...
ibc committed Apr 2, 2013
1 parent 3918312 commit c03b2e0b20cf2baeffb8bc181e1e3ff8968a082f
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/em/protocols/httpclient.rb
@@ -127,7 +127,7 @@ def send_request args
# Allow an override for the host header if it's not the connect-string.
host = args[:host_header] || args[:host] || "_"
# For now, ALWAYS tuck in the port string, although we may want to omit it if it's the default.
port = args[:port]
port = args[:port].to_i != 80 ? ":#{args[:port]}" : ""
# POST items.
postcontenttype = args[:contenttype] || "application/octet-stream"
@@ -138,7 +138,7 @@ def send_request args
# TODO: We ASSUME the caller wants to send a 1.1 request. May not be a good assumption.
req = [
"#{verb} #{request}#{qs} HTTP/#{version}",
"Host: #{host}:#{port}",
"Host: #{host}#{port}",
"User-agent: Ruby EventMachine",
]

0 comments on commit c03b2e0

Please sign in to comment.