Commit a49067aa authored by Nuno Cruces's avatar Nuno Cruces Committed by Brad Fitzpatrick

net/http: avoid sending unspecified time for directories

Change applies to sendFile.
This is already done for sendContent.

Change-Id: If43d9ab99e6e66a1363b08e0bdcceb57df1f855c
GitHub-Last-Rev: 1c47620a09a6f5e2b3d777fadaad6e0189de4af5
GitHub-Pull-Request: golang/go#34631
Reviewed-on: https://go-review.googlesource.com/c/go/+/198139Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 1820cca7
...@@ -610,7 +610,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec ...@@ -610,7 +610,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec
writeNotModified(w) writeNotModified(w)
return return
} }
w.Header().Set("Last-Modified", d.ModTime().UTC().Format(TimeFormat)) setLastModified(w, d.ModTime())
dirList(w, r, f) dirList(w, r, f)
return return
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment