module OMCMS class SetHeader < Faraday::Middleware HEADERS = { :"user-agent" => "omcms/ruby/client/#{VERSION}" } def initialize app super app @app = app end def on_request request_env request_env[:request_headers].merge! HEADERS end end end Faraday::Request.register_middleware(omcms_set_header: OMCMS::SetHeader)