django-cors-middleware icon indicating copy to clipboard operation
django-cors-middleware copied to clipboard

CORS accept Post Requests from other domain

Open vitormorales opened this issue 8 years ago • 1 comments
trafficstars

I have a API with django-rest-framework and django-cors-headers configured in stage env

CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = (
'myotherdmain.com',
)
CSRF_TRUSTED_ORIGINS = (
'myotherdomain.com',
)

When I do GET requests from my localhost to the published API is blocked and ok. But if I try POST requests I don't recieve any error message and the request is allowed. What am I doing wrong ? What I get is: with CORS, API will not allowed to recieve any request from other domain wich isn't in CORS_ORIGIN_WHITELIST.

Ideas? Django version: 1.10.5

Thanks !

vitormorales avatar Mar 21 '17 23:03 vitormorales

I am facing the same problem.

ashdaily avatar Jun 18 '19 17:06 ashdaily