Permalink
Browse files

fixing bug when port is default (actually port is nil) which creates …

…a stray ':' in headers.
  • Loading branch information...
1 parent c13ae49 commit 8bcb37303fdb7fdcafab48288e2f5d08184c1114 @jondot jondot committed Nov 2, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/web_socket.rb
View
@@ -79,7 +79,7 @@ def initialize(arg, params = {})
end
@path = (uri.path.empty? ? "/" : uri.path) + (uri.query ? "?" + uri.query : "")
- host = uri.host + (uri.port == default_port ? "" : ":#{uri.port}")
+ host = uri.host + ((uri.port.nil? || uri.port == default_port) ? "" : ":#{uri.port}")
origin = params[:origin] || "http://#{uri.host}"
key1 = generate_key()
key2 = generate_key()

0 comments on commit 8bcb373

Please sign in to comment.