mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 09:59:13 +08:00
cmds: fix error header output
using Header().Set after WriteHeader() has no effect. cc @mappum
This commit is contained in:
@ -95,8 +95,8 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
out, err := res.Reader()
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Header().Set(contentTypeHeader, "text/plain")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user