Permalink
Browse files

Fix SERVER_PORT in the rack handler and add LOCAL_PORT

  • Loading branch information...
1 parent cebc21f commit 54aab106caf746515e78962ac37e6c16ee96c312 @carllerche carllerche committed Mar 2, 2011
Showing with 4 additions and 1 deletion.
  1. +3 −1 lib/kirk/server/handler.rb
  2. +1 −0 spec/server/rack_spec.rb
View
4 lib/kirk/server/handler.rb
@@ -15,6 +15,7 @@ class Handler < Jetty::AbstractHandler
QUERY_STRING = 'QUERY_STRING'.freeze
SERVER_NAME = 'SERVER_NAME'.freeze
SERVER_PORT = 'SERVER_PORT'.freeze
+ LOCAL_PORT = 'LOCAL_PORT'.freeze
CONTENT_TYPE = 'CONTENT_TYPE'.freeze
CONTENT_LENGTH = 'CONTENT_LENGTH'.freeze
REQUEST_URI = 'REQUEST_URI'.freeze
@@ -73,7 +74,8 @@ def handle(target, base_request, request, response)
REMOTE_HOST => request.get_remote_host || "",
REMOTE_ADDR => request.get_remote_addr || "",
REMOTE_USER => request.get_remote_user || "",
- SERVER_PORT => request.get_local_port.to_s,
+ SERVER_PORT => request.get_server_port.to_s,
+ LOCAL_PORT => request.get_local_port.to_s,
RACK_VERSION => ::Rack::VERSION)
# Process the content length
View
1 spec/server/rack_spec.rb
@@ -29,6 +29,7 @@
'REMOTE_ADDR' => '127.0.0.1',
'REMOTE_USER' => '',
'SERVER_PORT' => '80',
+ 'LOCAL_PORT' => '9090',
'CONTENT_LENGTH' => "0",
'HTTP_HOST' => "example.org",

0 comments on commit 54aab10

Please sign in to comment.