Skip to content

Commit 5836afc

Browse files
authored
WebSocket config: Fix headers (#4177)
Fixes #4176
1 parent 7d0a80b commit 5836afc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

infra/conf/transport_internet.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,13 @@ func (c *WebSocketConfig) Build() (proto.Message, error) {
165165
}
166166
// Priority (client): host > serverName > address
167167
for k, v := range c.Headers {
168-
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
169-
if c.Host == "" {
170-
c.Host = v
168+
if strings.ToLower(k) == "host"{
169+
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
170+
if c.Host == "" {
171+
c.Host = v
172+
}
173+
delete(c.Headers, k)
171174
}
172-
delete(c.Headers, k)
173175
}
174176
config := &websocket.Config{
175177
Path: path,

0 commit comments

Comments
 (0)