support all versions of HTTP, fixes #38

This commit is contained in:
Josh Baker 2016-08-26 06:55:22 -07:00
parent 7b8c2dae85
commit 01c05b2ce9
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ func (ar *AnyReaderWriter) ReadMessage() (*Message, error) {
if err != nil {
return nil, err
}
if strings.HasSuffix(line, " HTTP/1.1") {
if len(line) > 9 && line[len(line)-9:len(line)-3] == " HTTP/" {
return ar.readHTTPMessage()
}
case '$':