1
0

Added User-Agent to logs.

This commit is contained in:
Alexander Andreev 2022-02-10 22:50:13 +04:00
parent 287a53532d
commit c4c07813af
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -181,8 +181,8 @@ func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) {
netTyp, _ := utils.NetworkType(r.Host)
h.logUpload.Printf("| %s | %s | %s | SHA256 %s | %s | %d", r.RemoteAddr, netTyp,
fHandler.Filename, fSha256, fSaltedHash, fHandler.Size)
h.logUpload.Printf("| %s | %s | %s | SHA256 %s | %s | %d | %s", r.RemoteAddr, netTyp,
fHandler.Filename, fSha256, fSaltedHash, fHandler.Size, r.UserAgent())
w.WriteHeader(http.StatusCreated)
} else {
@ -234,7 +234,7 @@ func (h *UploadHandlers) Download(w http.ResponseWriter, r *http.Request) {
netTyp, _ := utils.NetworkType(r.Host)
h.logDownload.Printf("| %s | %s | %s | %s", r.RemoteAddr, netTyp, name, saltedHash)
h.logDownload.Printf("| %s | %s | %s | %s | %s", r.RemoteAddr, netTyp, name, saltedHash, r.UserAgent())
http.ServeContent(w, r, path, stat.ModTime(), fd)
}