mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-17 06:50:27 +00:00
HTTP inbound: Fix a potential panic in readResponseAndHandle100Continue() (#6545)
This commit is contained in:
@@ -332,7 +332,7 @@ func readResponseAndHandle100Continue(r *bufio.Reader, req *http.Request, writer
|
||||
return nil, errors.New("failed to read http 1xx response").Base(err)
|
||||
}
|
||||
ResponseHeader1xx = append(ResponseHeader1xx, data...)
|
||||
if bytes.Equal(ResponseHeader1xx[len(ResponseHeader1xx)-4:], []byte{'\r', '\n', '\r', '\n'}) {
|
||||
if len(ResponseHeader1xx) >= 4 && bytes.Equal(ResponseHeader1xx[len(ResponseHeader1xx)-4:], []byte{'\r', '\n', '\r', '\n'}) {
|
||||
break
|
||||
}
|
||||
if len(ResponseHeader1xx) > 1024 {
|
||||
|
||||
Reference in New Issue
Block a user