Sha256: c45507f621ccc8d3bfe6fbcdc25f9a53a1ad5b4de46c2352861d9741239d43ec
Contents?: true
Size: 390 Bytes
Versions: 13
Compression:
Stored size: 390 Bytes
Contents
require 'faraday' module Faraday class Request::BasicAuth < Faraday::Middleware require 'base64' def call(env) header = Base64.encode64("#{@options[:username]}:#{@options[:password]}") env[:request_headers]['Authorization'] = "Basic #{header.to_s}" @app.call(env) end def initialize(app, options) @app, @options = app, options end end end
Version data entries
13 entries across 13 versions & 2 rubygems