TRA-4140 Fix HTTP/1.0 is recognized as HTTP/1.1 (#666)

This commit is contained in:
M. Mert Yıldıran
2022-01-20 11:02:21 +03:00
committed by GitHub
parent d5fd2ff1da
commit b31af7214b
6 changed files with 40 additions and 22 deletions

View File

@@ -235,8 +235,8 @@ func checkIsHTTP2ServerStream(b *bufio.Reader) (bool, error) {
return false, err
}
// If response starts with this text, it is HTTP/1.x
if bytes.Compare(buf, []byte("HTTP/1.0 ")) == 0 || bytes.Compare(buf, []byte("HTTP/1.1 ")) == 0 {
// If response starts with HTTP/1. then it's not HTTP/2
if bytes.HasPrefix(buf, []byte("HTTP/1.")) {
return false, nil
}