You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DELETE request should be not fired with Content-Type header set to application/json.
What happened instead:
DELETE request is being fired with Content-Type header set to application/json.
DELETE requests are usually fired with empty body and that is happening correctly with ra-data-simple-rest as well but the only problem is Content-Type request header is being set which shouldn't be case.
This fails with frameworks like fastify. Related discussion here: fastify/fastify#297 (comment).
Steps to reproduce:
Delete an entity from the UI and observe the HTTP request headers.
Other information:
This is happening mainly because of the assumption in the code that all requests should be fired with Content-Type set to application/json in the fetch.ts file.
I'd say that it's not really incorrect - the HTTP standard doesn't force any content type for responses with an empty body. I'd say that a strict interpretation of the HTTP standard by some server libraries have them decode the body as soon as the content-type says the content is JSON, but that's their problem.
That being said, it doesn't do any harm to change the content-type header to text/plain for delete in ra-data-simple-rest.
I'm marking this as a bug, feel free to submit a PR to fix it!
What you were expecting:
DELETE request should be not fired with Content-Type header set to application/json.
What happened instead:
DELETE request is being fired with Content-Type header set to application/json.
DELETE requests are usually fired with empty body and that is happening correctly with ra-data-simple-rest as well but the only problem is Content-Type request header is being set which shouldn't be case.
This fails with frameworks like fastify. Related discussion here: fastify/fastify#297 (comment).
Steps to reproduce:
Delete an entity from the UI and observe the HTTP request headers.
Other information:
This is happening mainly because of the assumption in the code that all requests should be fired with Content-Type set to application/json in the fetch.ts file.
Environment
The text was updated successfully, but these errors were encountered: