net/http: use method constant in check

This commit is contained in:
Leo Antunes 2022-10-28 21:11:46 +02:00
parent d08c9a075c
commit 94fc031814
1 changed files with 1 additions and 1 deletions

View File

@ -333,7 +333,7 @@ func serveContent(w ResponseWriter, r *Request, name string, modtime time.Time,
w.WriteHeader(code)
if r.Method != "HEAD" {
if r.Method != MethodHead {
if sendSize == size {
// use Copy in the non-range case to make use of WriterTo if available
io.Copy(w, sendContent)