Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Use Config.Filter to skip middleware #154

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

frzi
Copy link
Contributor

@frzi frzi commented Mar 2, 2023

It seems like Config.Filter remained unused. One can now skip the websocket middleware if so desired. Returning false in the function means the middleware will be skipped and c.Next() will be called instead.

app.Use(websocket.New(func(c *websocket.Conn) {
	// Etc...
}, websocket.Config{
	Filter: func(c *fiber.Ctx) bool {
		return websocket.IsWebSocketUpgrade(c)
	},
}))

@ReneWerner87 ReneWerner87 merged commit 3378407 into gofiber:master Mar 2, 2023
@frzi frzi deleted the config-filter branch March 9, 2023 08:59
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants