Skip to content
Browse files

WebMock::RackResponse supports basic auth

  • Loading branch information...
1 parent 4a0382d commit 466267f40ff3abd9a10123038a2c98c2dbbbaf37 @jugyo jugyo committed Mar 30, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/webmock/rack_response.rb
View
2 lib/webmock/rack_response.rb
@@ -38,6 +38,8 @@ def build_rack_env(request)
'SERVER_NAME' => uri.host
}
+ env['HTTP_AUTHORIZATION'] = 'Basic ' + [uri.userinfo].pack('m').delete("\r\n") if uri.userinfo
+
# Rack-specific variables
env['rack.input'] = StringIO.new(body)
env['rack.version'] = Rack::VERSION

0 comments on commit 466267f

Please sign in to comment.
Something went wrong with that request. Please try again.