Permalink
Browse files

WebMock::RackResponse supports basic auth

  • Loading branch information...
1 parent 4a0382d commit 466267f40ff3abd9a10123038a2c98c2dbbbaf37 @jugyo committed Mar 30, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 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

1 comment on commit 466267f

@bblimke

Looks good. Thanks for adding this support.
It only requires a spec now to be merged into master.

Please sign in to comment.