From 41a5bc5a0505570966f7260e9ca601847cd8d8a6 Mon Sep 17 00:00:00 2001 From: drswinghead Date: Mon, 23 Apr 2018 21:26:22 +0800 Subject: [PATCH] Fix HTTP/2.0 status line check. --- http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http.go b/http.go index d20763bc..e471c0c2 100644 --- a/http.go +++ b/http.go @@ -692,7 +692,7 @@ func parseResponse(sv *serverConn, r *Request, rp *Response) (err error) { } proto := f[0] - if !bytes.Equal(proto[0:7], []byte("HTTP/1.")) { + if !(bytes.Equal(proto[0:7], []byte("HTTP/1.")) || bytes.Equal(proto[0:7], []byte("HTTP/2."))) { return fmt.Errorf("invalid response status line: %s request %v", string(f[0]), r) } if proto[7] == '1' {