@cryptotaxi247 / kubo / commits / 3ae6117c5

server/http: Don't cast res.Error() to an Error (fixes panix on response errors)

Matt Bell committed Oct 22, 2014 at 15:44 UTC 3ae6117c5b35df55c9c375fea1a8d9c37cde9441
1 file changed +1 -3
server/http/http.go
+1 -3
@@ -104,9 +104,7 @@ func (i *apiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
104 res := commands.Root.Call(req)
105
106 // if response contains an error, write an HTTP error status code
107 - if err = res.Error(); err != nil {
108 - e := err.(cmds.Error)
109 -
107 + if e := res.Error(); e != nil {
108 if e.Code == cmds.ErrClient {
109 w.WriteHeader(http.StatusBadRequest)
110 } else {