1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_controller/metal/default_headers.rb
Kevin Deisz f22bc41a92
Include default headers by default in API mode
ActionDispatch's default headers are now moved into their own module that are by default included in both Base and API. This allows API-mode applications to take advantage of the default security headers, as well as providing an easy way to add more.
2018-04-06 15:13:28 -04:00

17 lines
394 B
Ruby

# frozen_string_literal: true
module ActionController
# Allows configuring default headers that will be automatically merged into
# each response.
module DefaultHeaders
extend ActiveSupport::Concern
module ClassMethods
def make_response!(request)
ActionDispatch::Response.create.tap do |res|
res.request = request
end
end
end
end
end