Method: Bandwidth::VoiceBasicAuth.apply
- Defined in:
- lib/bandwidth/http/auth/voice_basic_auth.rb
.apply(config, http_request) ⇒ Object
Add basic authentication to the request. be added.
14 15 16 17 18 19 20 |
# File 'lib/bandwidth/http/auth/voice_basic_auth.rb', line 14 def self.apply(config, http_request) username = config.voice_basic_auth_user_name password = config.voice_basic_auth_password value = Base64.strict_encode64("#{username}:#{password}") header_value = "Basic #{value}" http_request.headers['Authorization'] = header_value end |