Support for decorators
See original GitHub issueI’ve seen in the past people were talking about having support for decorators instead of being stuck with just CORS_URLS_REGEX
I’d like to re-open the request to support decorators so that it’s very easy to limit CORS responses to specific views.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Experimental decorators warning in TypeScript compilation
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option `to ...
Read more >Solving warning: “Experimental support for decorators is a ...
This article describes how to solve this warning that could be shown after use “decorators” in TypeScript. WHAT IS A DECORATOR. A “decorator”...
Read more >Experimental support for decorators is a feature that is subject ...
To solve the error "Experimental support for decorators is a feature that is subject to change in a future release", make sure to...
Read more >Error warning message: "Experimental support for decorators ...
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to ...
Read more >How to remove experimentalDecorators warning in VSCode
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another vote for this here: I run the Django admin on a domain that also hosts a couple of API endpoints. I want to allow CORS for those endpoints, and I was hoping I could do it with a view decorator rather than having to add a middleware that affects every request to my site.
I’ll use
CORS_URLS_REGEX
for the moment (somehow I didn’t spot that when scanning the README earlier but it turns out it’s documented there, I just missed it).Coming from the flask world I feel the same. Working with a single regular expression to convey your rules is a bit clunky, I would much rather decorate an endpoint with specific options.
This is the decorator I typically use with
flask-cors
: https://flask-cors.readthedocs.io/en/latest/api.html#decorator. It enables setting any of those options per endpoint.