Class: WebMock::RackResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/mocktra.rb

Overview

patch to support basic auth

Instance Method Summary collapse

Instance Method Details

#build_rack_env_with_basic_auth_support(request) ⇒ Object Also known as: build_rack_env



32
33
34
35
36
37
# File 'lib/mocktra.rb', line 32

def build_rack_env_with_basic_auth_support(request)
  env = build_rack_env_without_basic_auth_support(request)
  uri = request.uri
  env['HTTP_AUTHORIZATION'] = 'Basic ' + [uri.userinfo].pack('m').delete("\r\n") if uri.userinfo
  env
end