Class: PublishingPlatformApi::PublishingPlatformHeaderSniffer
- Inherits:
-
Object
- Object
- PublishingPlatformApi::PublishingPlatformHeaderSniffer
- Defined in:
- lib/publishing_platform_api/middleware/publishing_platform_header_sniffer.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, header_name) ⇒ PublishingPlatformHeaderSniffer
constructor
A new instance of PublishingPlatformHeaderSniffer.
Constructor Details
#initialize(app, header_name) ⇒ PublishingPlatformHeaderSniffer
Returns a new instance of PublishingPlatformHeaderSniffer.
5 6 7 8 |
# File 'lib/publishing_platform_api/middleware/publishing_platform_header_sniffer.rb', line 5 def initialize(app, header_name) @app = app @header_name = header_name end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 |
# File 'lib/publishing_platform_api/middleware/publishing_platform_header_sniffer.rb', line 10 def call(env) PublishingPlatformApi::PublishingPlatformHeaders.set_header(readable_name, env[@header_name]) @app.call(env) end |