diff options
-rw-r--r-- | upload-svr.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/upload-svr.go b/upload-svr.go index 9edb808..248b34c 100644 --- a/upload-svr.go +++ b/upload-svr.go @@ -20,7 +20,6 @@ import ( "path/filepath" "strconv" "strings" - "time" ) const ( @@ -351,7 +350,13 @@ func serveFile(w http.ResponseWriter, r *http.Request) { return } defer f.Close() - http.ServeContent(w, r, r.URL.Path, time.Time{}, f) + fileInfo, err := f.Stat() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + log.Println(err) + return + } + http.ServeContent(w, r, r.URL.Path, fileInfo.ModTime(), f) } var ( |