Currently, Deno's HTTP server performs some automatic transformation of body and headers. This limits you, for example, from implementing `HEAD` requests in such a way that headers are identical for both `HEAD` and `GET`. The HTTP spec doesn't say they MUST be identical, but they SHOULD be identical, and you really can't make that the case if Deno's internals modify your request differently depending on whether or not you include the body in your response or leave it null. If you could somehow hook whatever performs this transformation, you could (in this case) take the complete response Deno is going to send, and then strip out the body. I would love to see something like the following. ``` function myTransform(resp: Response, req: Request) { //not going to actually change anything here return Deno.defaultTransformResponse(resp, req) } Deno.serve({ hostname: "::1", port: 8080, transformResponse: myTransform }, (req) =>{ return new Response(...) }) ```
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by FergoTheGreat and has received 2 comments.