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

14 lines
287 B
Ruby
Raw Normal View History

2014-09-03 08:49:59 +00:00
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