Class: Faraday::Request::BasicAuthentication

Inherits:
Object
  • Object
show all
Defined in:
lib/faraday/request/basic_authentication.rb

Overview

Authorization middleware for Basic Authentication.

Class Method Summary collapse

Class Method Details

.header(login, pass) ⇒ String

Returns a Basic Authentication header line.

Parameters:

  • login (String)
  • pass (String)

Returns:

  • (String)

    a Basic Authentication header line


13
14
15
16
17
# File 'lib/faraday/request/basic_authentication.rb', line 13

def self.header(, pass)
  value = Base64.encode64([, pass].join(':'))
  value.delete!("\n")
  super(:Basic, value)
end