Update data.go (#1)

This commit is contained in:
Andrew 2024-03-07 16:24:42 +08:00 committed by GitHub
parent e167c3e1ef
commit 64721abaa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,11 +66,8 @@ func handle(fn handleFunc, prefix string, store *storage.Storage, server *settin
server: server,
})
if status >= 400 || err != nil {
clientIP := realip.FromRequest(r)
log.Printf("%s: %v %s %v", r.URL.Path, status, clientIP, err)
}
clientIP := realip.FromRequest(r)
log.Printf("%s: %v %s %v", r.URL.Path, status, clientIP, err)
if status != 0 {
txt := http.StatusText(status)
http.Error(w, strconv.Itoa(status)+" "+txt, status)