2019-04-28 21:10:54 +03:00
|
|
|
require "active_support/concern"
|
2016-11-04 15:34:44 +02:00
|
|
|
|
|
|
|
module PublicApiExposing
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2016-11-17 18:46:40 +02:00
|
|
|
def set_access_control_headers
|
|
|
|
if request.format.json?
|
2019-04-28 21:10:54 +03:00
|
|
|
response.headers["Access-Control-Allow-Origin"] = "*"
|
2016-11-17 18:46:40 +02:00
|
|
|
end
|
|
|
|
end
|
2019-04-28 21:10:54 +03:00
|
|
|
|
2016-11-04 15:34:44 +02:00
|
|
|
included do
|
|
|
|
before_action :set_access_control_headers
|
|
|
|
end
|
|
|
|
end
|