In order to access my api from frontend it is asking I declare Content-Range in the Access-Control-Expose-Headers header. I can't figure out exactly how to write it.
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '*',
headers: ["Access-Control-Expose-Headers", "Content-Range: 0-24/319"],
methods: [:get, :post, :put, :patch, :delete, :options, :head]
end
end
or
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins '*'
resource '*',
headers: :any,
expose: ["Content-Range: orders 0-24/319"],
methods: [:get, :post, :put, :patch, :delete, :options, :head]
end
end
Any idea what I've written incorrectly?
according to test case in original repo there is no possibility to pass
key: valuepair inside routes definition that would be accepted by rack-corsand then for example, you can write default value in
BaseControllerand then inherit every controller from itand then in your controller just call it