Class: Charcoal::CrossOriginController
- Inherits:
-
ActionController::Metal
- Object
- ActionController::Metal
- Charcoal::CrossOriginController
- Includes:
- AbstractController::Callbacks, ActionController::Head, ActionController::Instrumentation, CrossOrigin, Utilities
- Defined in:
- lib/charcoal/cross_origin_controller.rb
Constant Summary
Constants included from Utilities
Instance Method Summary collapse
-
#preflight ⇒ Object
OPTIONS *.
Methods included from Utilities
Methods included from CrossOrigin
Instance Method Details
#preflight ⇒ Object
OPTIONS *
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/charcoal/cross_origin_controller.rb', line 23 def preflight if allowed_methods.any? set_cors_headers headers["Access-Control-Allow-Methods"] = allowed_methods.join(",").upcase headers["Access-Control-Max-Age"] = Charcoal.configuration["max-age"].to_s headers["Access-Control-Allow-Headers"] = Charcoal.configuration["allow-headers"].join(",") end head :ok, content_type: "text/plain" end |