fix(commands/http/handler) check if found

@mappum, could you CR this and let me know if I've interpreted the
desired behavior correctly?
This commit is contained in:
Brian Tiger Chow 2014-11-11 23:38:33 -08:00 committed by Juan Batiz-Benet
parent bff646fb26
commit c46102cec5

View File

@ -57,8 +57,8 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set(streamHeader, "1")
} else {
enc, err := req.Option(cmds.EncShort).String()
if err != nil || len(enc) == 0 {
enc, found, err := req.Option(cmds.EncShort).String()
if err != nil || !found {
w.WriteHeader(http.StatusInternalServerError)
return
}