Fix http requests not working

fixes #294
This commit is contained in:
Josh Baker 2018-04-09 08:27:04 -07:00
parent 0659e0c705
commit 2e7003bc31
1 changed files with 20 additions and 19 deletions

View File

@ -223,8 +223,12 @@ moreData:
if !complete {
break
}
if len(args) > 0 {
if kind != kindHTTP {
if kind == kindHTTP {
if len(msg.Values) == 0 {
return nil, errInvalidHTTP
}
msgs = append(msgs, msg)
} else if len(args) > 0 {
msg.Command = strings.ToLower(string(args[0]))
for i := 0; i < len(args); i++ {
args[i] = append([]byte{}, args[i]...)
@ -241,9 +245,6 @@ moreData:
msg.ConnType = RESP
msg.OutputType = RESP
}
} else if len(msg.Values) == 0 {
return nil, errInvalidHTTP
}
msgs = append(msgs, msg)
}
data = leftover