Sha256: 159ba2ca9dbd079716ccba1e24f53842d5afe889331c446018e39da8cb227d41
Contents?: true
Size: 477 Bytes
Versions: 24
Compression:
Stored size: 477 Bytes
Contents
# frozen_string_literal: true module FinApps module Middleware # This middleware sets the User-Agent request-header field to identify thei client. class UserAgent < Faraday::Middleware KEY = 'User-Agent' unless defined? KEY RUBY = "#{RUBY_ENGINE}/#{RUBY_PLATFORM} #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" def call(env) env[:request_headers][KEY] = "finapps-ruby/#{FinApps::VERSION} (#{RUBY})" @app.call(env) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems