mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-05 00:47:51 -05:00
Early detection of non http traffic to match web server behavior
This commit is contained in:
parent
087a62ef3d
commit
221a13e658
@ -89,6 +89,10 @@ func (h *HeaderReader) Read(reader io.Reader) (*buf.Buffer, error) {
|
|||||||
leftover := buffer.BytesFrom(-lenEnding)
|
leftover := buffer.BytesFrom(-lenEnding)
|
||||||
buffer.Clear()
|
buffer.Clear()
|
||||||
copy(buffer.Extend(lenEnding), leftover)
|
copy(buffer.Extend(lenEnding), leftover)
|
||||||
|
|
||||||
|
if _, err := readRequest(bufio.NewReader(bytes.NewReader(headerBuf.Bytes())), false); err != io.ErrUnexpectedEOF {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user