'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed
See original GitHub issueI am using django-cors-headers and I have deployed my application on server, but still I am getting this issue. My current setting for CORS are
INSTALLED_APPS = ['corsheaders']
MIDDLEWARE_CLASSES = ['corsheaders.middleware.CorsMiddleware', 'corsheaders.middleware.CorsPostCsrfMiddleware']
CORS_ORIGIN_ALLOW_ALL = True
CORS_REPLACE_HTTPS_REFERER = True
CORS_ALLOW_HEADERS = (
'x-requested-with',
'content-type',
'accept',
'origin',
'authorization',
'x-csrftoken',
'accept-encoding'
)
CORS_ALLOW_METHODS = (
'GET',
'POST',
'PUT',
'PATCH',
'DELETE',
'OPTIONS'
)
is there anyone who has resolved the following issue
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
The 'Access-Control-Allow-Origin' header contains multiple ...
The 'Access-Control-Allow-Origin' header contains multiple values 'http://127.0.0.1:9000, http://127.0.0.1:9000', but only one is allowed.
Read more >Solved: CORS Error : header contains multiple values
Hi All, I am getting "The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed." type of error when requesting...
Read more >The 'Access-Control-Allow-Origin' header contains multiple ...
The 'Access-Control-Allow-Origin' header contains multiple values, but only one is allowed. ... When defining multiple domains separated by coma ...
Read more >The 'Access-Control-Allow-Origin' header contains multiple ...
... website hosted on Plesk for Linux server: The 'Access-Control-Allow-Origin' header contains multiple values, but only one is allowed.
Read more >The 'Access-Control-Allow-Origin ... - Jitsi Community Forum
The 'Access-Control-Allow-Origin' header contains multiple values ... contains multiple values i.e domain name , *, but only one is allowed.
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
Removing
add_header Access-Control-Allow-Origin *;
from my nginx configuration solved this problem.This happens when there are multiple layers in the server stack setting CORS headers. You just need to decide if you’re going to set the headers with django-cors-headers or using another layer (such as nginx), not both.