Sha256: bc59f5e2e572a63bb73b7d4abb36df5af3553df9a43a65b7f2ad50c717e9d8cd

Contents?: true

Size: 352 Bytes

Versions: 5

Compression:

Stored size: 352 Bytes

Contents

module Faraday
  module Conductivity
    class RequestHeaders < Faraday::Middleware

      def initialize(app, headers)
        super(app)
        @headers = headers
      end

      def call(env)
        @headers.each do |header, value|
          env[:request_headers][header] ||= value
        end
        @app.call(env)
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
faraday-conductivity-2.0.0 lib/faraday/conductivity/request_headers.rb
faraday-conductivity-1.0.1 lib/faraday/conductivity/request_headers.rb
faraday-conductivity-1.0.0 lib/faraday/conductivity/request_headers.rb
faraday-conductivity-0.3.1 lib/faraday/conductivity/request_headers.rb
faraday-conductivity-0.3.0 lib/faraday/conductivity/request_headers.rb