Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #176 from oestrich/master

Add missing required rack environment key
  • Loading branch information...
commit 418c9aaa3b658cc94337b77139e530de216694fb 2 parents cd6722c + a2ce124
@bblimke authored
Showing with 3 additions and 2 deletions.
  1. +2 −1  lib/webmock/rack_response.rb
  2. +1 −1  spec/support/my_rack_app.rb
View
3  lib/webmock/rack_response.rb
@@ -36,7 +36,8 @@ def build_rack_env(request)
'PATH_INFO' => uri.path,
'QUERY_STRING' => uri.query || '',
'SERVER_NAME' => uri.host,
- 'SERVER_PORT' => uri.port
+ 'SERVER_PORT' => uri.port,
+ 'SCRIPT_NAME' => ""
}
env['HTTP_AUTHORIZATION'] = 'Basic ' + [uri.userinfo].pack('m').delete("\r\n") if uri.userinfo
View
2  spec/support/my_rack_app.rb
@@ -27,7 +27,7 @@ def self.call(env)
name = env["rack.input"].read[/name=([^&]*)/, 1] || "World"
[200, {}, ["Good to meet you, #{name}!"]]
when ['GET', '/compute']
- if env['SERVER_PORT'] == 80
+ if env['SERVER_PORT'] == 80 && env["SCRIPT_NAME"] == ""
[200, {}, [""]]
else
[401, {}, [""]]
Please sign in to comment.
Something went wrong with that request. Please try again.