-
-
Notifications
You must be signed in to change notification settings - Fork 813
Closed
Description
It would be useful if Datasette could be configured to allow CORS requests from one or more origins, as opposed to only allowing either none or "*".
This is slightly tricky because the Access-Control-Allow-Origin: https://foo.example header is only allowed to return one value per request - and according to https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS "The Access-Control-Allow-Origin header should contain the value that was sent in the request's Origin header."
This means the application code needs to have a whitelist of allowed hosts and code that dynamically changes the outgoing Access-Control-Allow-Origin header based on the Origin header from the incoming request.
Reactions are currently unavailable