Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why Request Method:OPTIONS is required? #191

Open
gormonn opened this issue Jan 18, 2018 · 2 comments
Open

Why Request Method:OPTIONS is required? #191

gormonn opened this issue Jan 18, 2018 · 2 comments
Labels

Comments

@gormonn
Copy link

gormonn commented Jan 18, 2018

Each request is duplicated with "request method: OPTIONS", why?
And how to disable it?
screenshot_8

@lexich
Copy link
Owner

lexich commented Jan 18, 2018

Hi @gormonn
Show your redux-api config and how do you use redux-api in your app?

@grahaml
Copy link

grahaml commented Jan 26, 2018

I doubt this has anything to do with the library. This is the standard behaviour for CORS. If your API is on a different domain than your client-side application (eg. myapplication.com is trying to request data from myapi.com), then the browser sends a pre-flight request (the OPTIONS request you are seeing) to determine whether or not the request your application wants to make will be accepted by the API.

Have a look at MDN for a good explanation: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests

This is a security measure that the browser implements, and as far as I know there is no way to disable it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants