Skip to content

feat: Add support for excluding routes in middleware#19

Merged
agis merged 1 commit intomainfrom
excluded-routes
Sep 20, 2022
Merged

feat: Add support for excluding routes in middleware#19
agis merged 1 commit intomainfrom
excluded-routes

Conversation

@agis
Copy link
Copy Markdown
Member

@agis agis commented Sep 20, 2022

This patch adds a new configuration option, with which one is able to declare routes that the middleware should not execute on.

This is done by either specifying an exact match, e.g. "/foo" or a prefix match, e.g. "/foo/*".

The latter syntax is implemented using a naive linear search, but since most people will use only a handful of those entries, this should be fine. (If we want to optimize this later on, we could use a prefix tree or something similar.)

@agis agis changed the title feat: Add support for excluding routes feat: Add support for excluding routes in middleware Sep 20, 2022
This patch adds a new configuration option, with which one is able to
declare routes that the middleware should not execute on.

This is done by either specifying an exact match, e.g. "/foo" or a
prefix match, e.g. "/foo/*".

The latter syntax is implemented using a naive linear search, but since
most people will use only a handful of those entries, my instinct tells
me this is fine. If we want to optimize this later on, we could use a
prefix tree or something similar.
@agis agis merged commit da46d3a into main Sep 20, 2022
@agis agis deleted the excluded-routes branch September 20, 2022 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants