mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-21 19:22:18 -05:00
14 lines
416 B
Ruby
14 lines
416 B
Ruby
Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
|
# Allow cross-origin requests for API content types
|
|
allow do
|
|
origins "*"
|
|
resource "/models/*/model_files/*",
|
|
headers: [:any],
|
|
methods: [:get, :options, :head]
|
|
resource "*",
|
|
headers: [:any],
|
|
methods: [:any],
|
|
if: ->(env) { env["HTTP_ACCEPT"]&.split(", ")&.include? Mime[:manyfold_api_v0].to_s }
|
|
end
|
|
end
|