mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 19:33:32 +02:00
WebSocket config: Fix headers
(#4177)
Fixes https://github.com/XTLS/Xray-core/issues/4176
This commit is contained in:
parent
7d0a80b501
commit
5836afc41f
1 changed files with 6 additions and 4 deletions
|
@ -165,12 +165,14 @@ func (c *WebSocketConfig) Build() (proto.Message, error) {
|
||||||
}
|
}
|
||||||
// Priority (client): host > serverName > address
|
// Priority (client): host > serverName > address
|
||||||
for k, v := range c.Headers {
|
for k, v := range c.Headers {
|
||||||
|
if strings.ToLower(k) == "host"{
|
||||||
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
|
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
|
||||||
if c.Host == "" {
|
if c.Host == "" {
|
||||||
c.Host = v
|
c.Host = v
|
||||||
}
|
}
|
||||||
delete(c.Headers, k)
|
delete(c.Headers, k)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
config := &websocket.Config{
|
config := &websocket.Config{
|
||||||
Path: path,
|
Path: path,
|
||||||
Host: c.Host,
|
Host: c.Host,
|
||||||
|
|
Loading…
Reference in a new issue