Multiple cors middlewares on same request?
See original GitHub issueI have an API where I want every path to be CORS-enabled for all origins except for /auth/connect/twitter
because it uses a cookie based session.
I was wondering if it would be possible to make it so that the last cors() middleware always overrides precedent ones. E.g.
router.use(cors())
router.use(cors({ origin: 'http://mydomain.com' }))
should set the Access-Control-Allow-Origin
to http://mydomain.com
. Is that possible?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Allow multiple CORS domain in express js - Stack Overflow
Using Node, cors middleware, make sure you leave the / off the url, ... This will allow request from localhost:3000 and origin2.com.
Read more >Rails CORS Middleware For Multiple Resources · Daniela Baron
In my case, I have a Rails server that provides some back end services for this blog (which is statically hosted on Github...
Read more >CORS for multiple Domains in Node and Express - Saumya
It allows to use resources from one server in another server. Well simply said it enables to call, APIs on one server, from...
Read more >Express cors middleware
CORS is a node.js package for providing a Connect/Express middleware that can be ... An example of a 'complex' CORS request is one...
Read more >Using CORS in Express - Medium
Cross-origin resource sharing (CORS) allows AJAX requests to skip the Same-origin policy and access resources from remote hosts. In this post I will...
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
Yes, I ended up doing something like this:
hey Hii every one i am new to opensource world can any one help me in making my first contribution in this library.by explaining it more to me and guiding me.