1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 23:47:07 -05:00

Early detection of non http traffic to match web server behavior

This commit is contained in:
Shelikhoo 2020-06-03 15:44:25 +08:00
parent 087a62ef3d
commit 221a13e658
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -89,6 +89,10 @@ func (h *HeaderReader) Read(reader io.Reader) (*buf.Buffer, error) {
leftover := buffer.BytesFrom(-lenEnding)
buffer.Clear()
copy(buffer.Extend(lenEnding), leftover)
if _, err := readRequest(bufio.NewReader(bytes.NewReader(headerBuf.Bytes())), false); err != io.ErrUnexpectedEOF {
return nil, err
}
}
}