mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 12:49:20 +02:00
Fix host in headers field does not work XTLS#3191
This commit is contained in:
parent
e2439c0483
commit
8a439bf3f2
|
@ -200,6 +200,14 @@ func (c *HttpUpgradeConfig) Build() (proto.Message, error) {
|
|||
path = u.String()
|
||||
}
|
||||
}
|
||||
// If http host is not set in the Host field, but in headers field, we add it to Host Field here.
|
||||
// If we don't do that, http host will be overwritten as address.
|
||||
// Host priority: Host field > headers field > address.
|
||||
if c.Host == "" && c.Headers["host"] != "" {
|
||||
c.Host = c.Headers["host"]
|
||||
} else if c.Host == "" && c.Headers["Host"] != "" {
|
||||
c.Host = c.Headers["Host"]
|
||||
}
|
||||
config := &httpupgrade.Config{
|
||||
Path: path,
|
||||
Host: c.Host,
|
||||
|
|
Loading…
Reference in New Issue