flask-cors icon indicating copy to clipboard operation
flask-cors copied to clipboard

add support for a dynamic origin

Open HHK1 opened this issue 5 years ago • 1 comments

Why

Fixes #281 Very close to #268 but I need to inject to request's origin in order to dynamically match the origin against a dynamic list. Also added some unit tests.

What

the origins option can now be a function returning a string, a regex or a list. Typical usecase is to allow the application to dynamically determine what the Access-Control-Allow-Origin should be, instead of injecting the full list of allowed values at app startup.

HHK1 avatar Oct 20 '20 12:10 HHK1

@corydolphin Any chance to have this reviewed ?

HHK1 avatar Nov 18 '20 14:11 HHK1