http: don't expose error
This commit is contained in:
parent
c38b146e69
commit
77119ed3a2
@ -25,16 +25,13 @@ func Handler(m *fm.FileManager) http.Handler {
|
|||||||
if code >= 400 {
|
if code >= 400 {
|
||||||
w.WriteHeader(code)
|
w.WriteHeader(code)
|
||||||
|
|
||||||
if err == nil {
|
txt := http.StatusText(code)
|
||||||
txt := http.StatusText(code)
|
log.Printf("%v: %v %v\n", r.URL.Path, code, txt)
|
||||||
log.Printf("%v: %v %v\n", r.URL.Path, code, txt)
|
w.Write([]byte(txt + "\n"))
|
||||||
w.Write([]byte(txt))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
w.Write([]byte(err.Error()))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user