twitter-status-bot/.gems/gems/faraday-0.9.0/lib/faraday/request/basic_authentication.rb

14 lines
287 B
Ruby

require 'base64'
module Faraday
class Request::BasicAuthentication < Request.load_middleware(:authorization)
# Public
def self.header(login, pass)
value = Base64.encode64([login, pass].join(':'))
value.gsub!("\n", '')
super(:Basic, value)
end
end
end