Class: OMCMS::SetHeader
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- OMCMS::SetHeader
- Defined in:
- lib/omcms/middleware/set_header.rb
Constant Summary collapse
- HEADERS =
{ "user-agent": "omcms/ruby/client/#{VERSION}" }.freeze
Instance Method Summary collapse
-
#initialize(app) ⇒ SetHeader
constructor
A new instance of SetHeader.
- #on_request(request_env) ⇒ Object
Constructor Details
#initialize(app) ⇒ SetHeader
Returns a new instance of SetHeader.
9 10 11 12 |
# File 'lib/omcms/middleware/set_header.rb', line 9 def initialize(app) super(app) @app = app end |
Instance Method Details
#on_request(request_env) ⇒ Object
14 15 16 |
# File 'lib/omcms/middleware/set_header.rb', line 14 def on_request(request_env) request_env[:request_headers].merge! HEADERS end |