File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ def pre_process
7272 if @backend . ssl?
7373 @request . env [ "rack.url_scheme" ] = "https"
7474
75+ if @backend . respond_to? ( :port )
76+ @request . env [ 'SERVER_PORT' ] = @backend . port . to_s
77+ end
78+
7579 if cert = get_peer_cert
7680 @request . env [ 'rack.peer_cert' ] = cert
7781 end
Original file line number Diff line number Diff line change 7878 expect ( @connection . remote_address ) . to eq ( "127.0.0.1" )
7979 end
8080
81- it "should return nil on error retreiving remote_address" do
81+ it "should return nil on error retrieving remote_address" do
8282 allow ( @connection ) . to receive ( :get_peername ) . and_raise ( RuntimeError )
8383 expect ( @connection . remote_address ) . to be_nil
8484 end
143143 it "should not set as threaded when app do not respond to deferred?" do
144144 expect ( @connection ) . not_to be_threaded
145145 end
146+
147+ it "should have correct SERVER_PORT when using ssl" do
148+ @connection . backend = double ( "backend" , :ssl? => true , :port => 443 )
149+
150+ @connection . process
151+
152+ expect ( @connection . request . env [ "SERVER_PORT" ] ) . to eq ( "443" )
153+ end
146154end
You can’t perform that action at this time.
0 commit comments