mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Fix WS reading X-Forwarded-For & Add tests (#3546)
Fixes https://github.com/XTLS/Xray-core/issues/3545 --------- Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>
This commit is contained in:
parent
9e6d7a3cb0
commit
a7e198e1e2
4 changed files with 15 additions and 11 deletions
|
@ -96,7 +96,7 @@ func TestDialWithRemoteAddr(t *testing.T) {
|
|||
return
|
||||
}
|
||||
|
||||
_, err = c.Write([]byte("Response"))
|
||||
_, err = c.Write([]byte(c.RemoteAddr().String()))
|
||||
common.Must(err)
|
||||
}(conn)
|
||||
})
|
||||
|
@ -113,7 +113,7 @@ func TestDialWithRemoteAddr(t *testing.T) {
|
|||
|
||||
var b [1024]byte
|
||||
n, _ := conn.Read(b[:])
|
||||
if string(b[:n]) != "Response" {
|
||||
if string(b[:n]) != "1.1.1.1:0" {
|
||||
t.Error("response: ", string(b[:n]))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue