We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 848598f commit 2ff4d6aCopy full SHA for 2ff4d6a
config/initializers/policy_headers.rb
@@ -0,0 +1,19 @@
1
+module OpenStreetMap
2
+ module Rack
3
+ class PolicyHeaders
4
+ COOP_HEADER = "Cross-Origin-Opener-Policy".freeze
5
+
6
+ def initialize(app)
7
+ @app = app
8
+ end
9
10
+ def call(env)
11
+ status, headers, response = @app.call(env)
12
+ headers[COOP_HEADER] = "same-origin" unless headers.key?(COOP_HEADER)
13
+ [status, headers, response]
14
15
16
17
+end
18
19
+Rails.configuration.middleware.use OpenStreetMap::Rack::PolicyHeaders
0 commit comments