Skip to content

Commit

Permalink
fix: prevent HEAD requests from writing body
Browse files Browse the repository at this point in the history
  • Loading branch information
pankgeorg committed Sep 20, 2023
1 parent 8f35185 commit 4099389
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Handlers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ function streamhandler(handler)
request.response::Response = handler(request)
request.response.request = request
startwrite(stream)
write(stream, request.response.body)
if request.method != "HEAD"
write(stream, request.response.body)
end
return
end
end
Expand Down

0 comments on commit 4099389

Please sign in to comment.