Skip to content

Commit

Permalink
WebSocket config: Fix headers (#4177)
Browse files Browse the repository at this point in the history
Fixes #4176
  • Loading branch information
rosebe authored Dec 17, 2024
1 parent 7d0a80b commit 5836afc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions infra/conf/transport_internet.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ func (c *WebSocketConfig) Build() (proto.Message, error) {
}
// Priority (client): host > serverName > address
for k, v := range c.Headers {
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
if c.Host == "" {
c.Host = v
if strings.ToLower(k) == "host"{
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
if c.Host == "" {
c.Host = v
}
delete(c.Headers, k)
}
delete(c.Headers, k)
}
config := &websocket.Config{
Path: path,
Expand Down

0 comments on commit 5836afc

Please sign in to comment.