Passthrough not working for cross-origin requests
See original GitHub issueHi,
I am setting up my routes like so:
new Server({
routes() {
this.post(<some-fully-qualified-route>, {...});
this.post(<another-fully-qualified-route>, {...});
this.passthrough();
}
});
This only passes through requests made on same origin but does nothing for the other cross-origin requests. Is this an expected behaviour? If yes, how can we achieve pass-through behaviour for all remaining request except for the one mentioned explicitly in the routes?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Cross origin requests #19 - miragejs/ember-cli-mirage - GitHub
What I'm trying to do is build a prototype backed by Ember-CLI-Mirage that uses Algolia for searching. I either need a way to...
Read more >Integration passthrough behaviors - Amazon API Gateway
For proxy integrations, API Gateway passes the entire request through to your backend, and you do not have the option to modify the...
Read more >I get a cross-origin error when making a HTTP requests
I noticed that I can to enter Application_BeginRequest but not into my function in the controller,which means CORES privilege issue.
Read more >Implement CORS in API Gateway - Alibaba Cloud
By using this mechanism, you can enable the browser to allow cross-origin requests. image. 2. CORS overview. 2.1 Two request validation modes.
Read more >React CORS Guide: What It Is and How to Enable It - StackHawk
See it in action and learn how to enable CORS in a React application. ... for requests from different origins are allowed to...
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
You can pass through all requests for a single domain like this
but unfortunately you can’t wildcard all domains. But,
passthrough
has a function version that you can use to perform whatever check you want:Let me know if that helps! Here are the full passthrough guides. I know this is a confusing API today, we have plans to improve it so you can passthrough anything that is not defined, and that’s very high priority behind some other stuff we’re working on now.
Hi @rassie
I think this seems reasonable, but I’m having a hard time visualizing a config that highlights this change. Could you share your server’s routes and examples of requests you’d like mirage to handle vs passthrough. That’ll help!
I think getting a test case of sorts in place is the best way to see what’s going on.