Closed blaksucram closed 9 months ago
I'm not sure where you got your information but according to RFC9110 and the MDN a DELETE request may have a body. It doesn't say webservers should always ignore it. If you have a backend that gets confused by it I suggest you open an issue with them to fix this.
Hello @erikdubbelboer.
Got it thanks!
But imho it does not make sense that the library "magically" makes up a Content-Type
header of application/octet-stream
in case a DELETE
request with no body and no Content-Type
header is executed.
You need to call ResponseHeader.SetNoDefaultContentType(true) to disable that behavior.
Thanks! That helped.
Whenever I send a DELETE request without a
Content-Type
header and a body fasthttp adds theapplication/octet-stream
Content-Type
to the request which then confuses some of the back-ends which we call with that request.As far as I read the several HTTP docs (mozilla and MSDN) a body should be ignored by the webservers which receive one in the DELETE request. This somehow does not fit the current logic which fasthttp implemented:
The
header.go
file contains logic which add a defaultContent-Type
header in case ofMaybe we can either add the DELETE request to the
RequestHeader.ignoreBody
method or maybe remove theignoreBody
call from theRequestHeader.AppendBytes
function.What do you think?
Thanks in advance Marcus