Skip to content

Commit 775b2ee

Browse files
hemachandarvvishr
authored andcommitted
Refactor DefaultProxyConfig Skipper & WebSocket Check in Context (#1297)
* refactor: default to DefaultProxyConfig.Skipper if not provided * refactor: use strings library for websocket check
1 parent 802fb5b commit 775b2ee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (c *context) IsTLS() bool {
234234

235235
func (c *context) IsWebSocket() bool {
236236
upgrade := c.request.Header.Get(HeaderUpgrade)
237-
return upgrade == "websocket" || upgrade == "Websocket"
237+
return strings.ToLower(upgrade) == "websocket"
238238
}
239239

240240
func (c *context) Scheme() string {

middleware/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func Proxy(balancer ProxyBalancer) echo.MiddlewareFunc {
200200
func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFunc {
201201
// Defaults
202202
if config.Skipper == nil {
203-
config.Skipper = DefaultLoggerConfig.Skipper
203+
config.Skipper = DefaultProxyConfig.Skipper
204204
}
205205
if config.Balancer == nil {
206206
panic("echo: proxy middleware requires balancer")

0 commit comments

Comments
 (0)