Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #193 from chrisrhoden/patch-2

Remove port from Host: header when port == 80
  • Loading branch information...
commit 1a217faeb15c57766fe94b646216c221d6c9e8a7 2 parents 2a3ab8e + a822437
@tmm1 tmm1 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/em/protocols/httpclient.rb
View
4 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",
]
Please sign in to comment.
Something went wrong with that request. Please try again.