feat: log file downloads
This commit is contained in:
@@ -487,6 +487,7 @@ func (s *Server) serveFile(w http.ResponseWriter, r *http.Request, p string, att
|
|||||||
if attachment {
|
if attachment {
|
||||||
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%q", fi.Name()))
|
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%q", fi.Name()))
|
||||||
}
|
}
|
||||||
|
s.logOp(r, fmt.Sprintf("download '%s'", p))
|
||||||
http.ServeContent(w, r, fi.Name(), fi.ModTime(), f)
|
http.ServeContent(w, r, fi.Name(), fi.ModTime(), f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user