mirror of
https://github.com/rclone/rclone.git
synced 2025-08-18 17:38:52 +02:00
rcserver: set Last-Modified
header for files served by --rc-serve
This commit is contained in:
committed by
Nick Craig-Wood
parent
3d473eb54e
commit
94cdb00eb6
@@ -35,6 +35,10 @@ func Object(w http.ResponseWriter, r *http.Request, o fs.Object) {
|
||||
w.Header().Set("Content-Type", mimeType)
|
||||
}
|
||||
|
||||
// Set last modified
|
||||
modTime := o.ModTime(r.Context())
|
||||
w.Header().Set("Last-Modified", modTime.UTC().Format(http.TimeFormat))
|
||||
|
||||
if r.Method == "HEAD" {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user