fix(commands/http/handler) check if found
@mappum, could you CR this and let me know if I've interpreted the desired behavior correctly?
Brian Tiger Chow committed
Nov 11, 2014 at 23:38 UTC
c46102cec57c1d38d5e72e3bb46fc51ffe2a57cd
1 file changed
+2
-2
commands/http/handler.go
+2
-2
@@ -57,8 +57,8 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
57
w.Header().Set(streamHeader, "1")
58
59
} else {
60
- enc, err := req.Option(cmds.EncShort).String()
61
- if err != nil || len(enc) == 0 {
60
+ enc, found, err := req.Option(cmds.EncShort).String()
61
+ if err != nil || !found {
62
w.WriteHeader(http.StatusInternalServerError)
63
return
64
}