diff options
| author | Nuno Cruces <ncruces@users.noreply.github.com> | 2019-10-01 09:31:50 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-10-01 15:27:28 +0000 |
| commit | a49067aab6eeff36d7219142ed52cc3db4d6c1d8 (patch) | |
| tree | 16c49d40d71ab250287658cb8139953a3aeba1da /src | |
| parent | 1820cca7d735574b4ac9647d3a8b996b5f97f3cc (diff) | |
| download | go-a49067aab6eeff36d7219142ed52cc3db4d6c1d8.tar.xz | |
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/+/198139
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/net/http/fs.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/fs.go b/src/net/http/fs.go index 27512411de..80c391d1c3 100644 --- a/src/net/http/fs.go +++ b/src/net/http/fs.go @@ -610,7 +610,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec writeNotModified(w) return } - w.Header().Set("Last-Modified", d.ModTime().UTC().Format(TimeFormat)) + setLastModified(w, d.ModTime()) dirList(w, r, f) return } |
