net/http: avoid sending unspecified time for directories

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

Change-Id: If43d9ab99e6e66a1363b08e0bdcceb57df1f855c
GitHub-Last-Rev: 1c47620a09
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>
This commit is contained in:
Nuno Cruces 2019-10-01 09:31:50 +00:00 committed by Brad Fitzpatrick
parent 1820cca7d7
commit a49067aab6
1 changed files with 1 additions and 1 deletions

View File

@ -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
}