mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 18:11:28 +00:00
Fix missing default host in v2ray http transport`s request
This commit is contained in:
parent
09b001e795
commit
4999441a85
|
@ -111,6 +111,7 @@ func (c *Client) dialHTTP(ctx context.Context) (net.Conn, error) {
|
||||||
request = request.WithContext(ctx)
|
request = request.WithContext(ctx)
|
||||||
switch hostLen := len(c.host); hostLen {
|
switch hostLen := len(c.host); hostLen {
|
||||||
case 0:
|
case 0:
|
||||||
|
request.Host = c.serverAddr.AddrString()
|
||||||
case 1:
|
case 1:
|
||||||
request.Host = c.host[0]
|
request.Host = c.host[0]
|
||||||
default:
|
default:
|
||||||
|
@ -144,6 +145,8 @@ func (c *Client) dialHTTP2(ctx context.Context) (net.Conn, error) {
|
||||||
request = request.WithContext(ctx)
|
request = request.WithContext(ctx)
|
||||||
switch hostLen := len(c.host); hostLen {
|
switch hostLen := len(c.host); hostLen {
|
||||||
case 0:
|
case 0:
|
||||||
|
// https://github.com/v2fly/v2ray-core/blob/master/transport/internet/http/config.go#L13
|
||||||
|
request.Host = "www.example.com"
|
||||||
case 1:
|
case 1:
|
||||||
request.Host = c.host[0]
|
request.Host = c.host[0]
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue