Sha256: c84906df00b2735bb2e1afa24b2b171b40856c6309277e0508884fd2aa48babd
Contents?: true
Size: 485 Bytes
Versions: 19
Compression:
Stored size: 485 Bytes
Contents
# frozen_string_literal: true module FinAppsCore 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/#{FinAppsCore::VERSION} (#{RUBY})" @app.call(env) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems