Remove all debugging calls.
This commit is contained in:
parent
be37f74317
commit
8a4104c3d5
@ -133,16 +133,14 @@ func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
defer fDst.Close()
|
||||
|
||||
n, err := io.Copy(fDst, f)
|
||||
_, err = io.Copy(fDst, f)
|
||||
if err != nil {
|
||||
h.logErr.Println("failed to copy uploaded file to destination:", err)
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
fmt.Println(n, err)
|
||||
fDst.Sync()
|
||||
fDst.Close()
|
||||
|
||||
h.logUpload.Printf("| %s | %s | %s | SHA256 %s | %s | %d", r.RemoteAddr, utils.NetworkType(r.Host),
|
||||
fHandler.Filename, fSha256, fSaltedHash, fHandler.Size)
|
||||
@ -150,6 +148,7 @@ func (h *UploadHandlers) Upload(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
} else {
|
||||
os.Chtimes(fPath, time.Now(), time.Now())
|
||||
w.WriteHeader(http.StatusFound)
|
||||
}
|
||||
|
||||
downloadURL := path.Join("/f", fSaltedHash, fHandler.Filename)
|
||||
|
Loading…
Reference in New Issue
Block a user