CORB `application/json` collision
See original GitHub issueHello.
I have a django json-rpc server and frontend which requests this json methods.
When browser make preflight request, server send this response:
(!) Here is correct response for OPTIONS query.
< HTTP/1.1 200 OK
< Server: gunicorn/19.7.1
< Date: Mon, 05 Aug 2019 17:47:12 GMT
< Connection: close
< Content-Type: text/html; charset=utf-8
< Content-Length: 0
< Vary: Origin
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Origin: https://order.reg.ru
< Access-Control-Allow-Headers: accept, accept-encoding, authorization, content-type, dnt, origin, user-agent, x-csrftoken, x-requested-with, x-csrf-token
< Access-Control-Allow-Methods: DELETE, GET, OPTIONS, PATCH, POST, PUT
< Access-Control-Max-Age: 86400
But web-browser (e.g. Chrome) thows warning about CORB violation, because browser expect Content-Type
from OPTIONS
response as application/json
.
How to override Content-Type
for all cors answers in project?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Cross site error when consumes = "application/json" present
When you are adding the consumes = "application/json" option, you explicitly say that the server expects application/json datatype. If the cors ...
Read more >Configuring CORS for content-type: application/json - Medium
Correctly configuring CORS for content-type: application/json. The use of dynamic requests to backend servers is prevalent in modern web ...
Read more >Has been blocked by cors policy [Explain like I am 5] - hinty
Just raise an exception immediately if the content-type request header is not JSON. A lot of frameworks do it for you. To understand...
Read more >Understanding Cross Origin Resource Sharing (CORS)
Cross-origin resource sharing (CORS) is a mechanism that allows a client application to request restricted resources hosted on server from a ...
Read more >Enabling Cross Origin Requests for a RESTful Web Service
We use GET in this case because it is convenient for testing. Spring will still reject a GET request where the origin doesn't...
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
It’s not directly possible but you can subclass the middleware from:
If this works for you please let me know as I’ll patch the library then. I haven’t found time to reproduce your issue.
OK, I’m checking for now.