mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-13 20:09:36 +03:00
WebSocket config: Fix headers
(#4177)
Fixes https://github.com/XTLS/Xray-core/issues/4176
This commit is contained in:
@ -165,11 +165,13 @@ 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 {
|
||||||
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
|
if strings.ToLower(k) == "host"{
|
||||||
if c.Host == "" {
|
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
|
||||||
c.Host = v
|
if c.Host == "" {
|
||||||
|
c.Host = v
|
||||||
|
}
|
||||||
|
delete(c.Headers, k)
|
||||||
}
|
}
|
||||||
delete(c.Headers, k)
|
|
||||||
}
|
}
|
||||||
config := &websocket.Config{
|
config := &websocket.Config{
|
||||||
Path: path,
|
Path: path,
|
||||||
|
Reference in New Issue
Block a user