Skip to content

Commit

Permalink
WebMock::RackResponse supports basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Mar 30, 2012
1 parent 4a0382d commit 466267f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/webmock/rack_response.rb
Expand Up @@ -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
Expand Down

1 comment on commit 466267f

@bblimke
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.