mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
f22bc41a92
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.
17 lines
394 B
Ruby
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
|