Update websocket.go

This commit is contained in:
Vincent 2018-04-30 09:42:33 +02:00 committed by GitHub
parent 1da33028ce
commit 95c210610f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,7 +107,7 @@ func wsHandshakeValidator(allowedOrigins []string) func(*websocket.Config, *http
log.Debug(fmt.Sprintf("Allowed origin(s) for WS RPC interface %v\n", origins.List())) log.Debug(fmt.Sprintf("Allowed origin(s) for WS RPC interface %v\n", origins.List()))
f := func(cfg *websocket.Config, req *http.Request) error { f := func(cfg *websocket.Config, req *http.Request) error {
origin := strings.ToLower(req.Header.Get("Origin")) origin := strings.ToLower(req.Header.Get("origin"))
if allowAllOrigins || origins.Has(origin) { if allowAllOrigins || origins.Has(origin) {
return nil return nil
} }