Using r.Use causes middleware to be hit on every request
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by tracing how app.Use(static.Serve()) invokes the static middleware and how the URL passed to .Serve is evaluated. Check the middleware's existing behavior and tests, then define the expected request matching and logging behavior before making a change. Done means requests outside the configured static URL no longer invoke that middleware unnecessarily.
Written by the indexing model from the issue text.
Description
When using the middleware as
app.Use(static.Serve())
Every request first hits the static middleware which causes errors to show up on in the logs indicating that the specified files do not exist.
Is there a better way to use the static middleware with its own middleware as well so it only gets hit when the request matches the url passed to the .Serve function?
- Dominant language
- Go
- Stars
- 321
- Forks
- 44
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gin-contrib/static
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
gin-contrib/static#55 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
gin-contrib/static#45 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
gin-contrib/static#9 · 1 comment · 3 reactions ·
-
No Caching? Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
gin-contrib/static#7 · 4 comments · 4 reactions ·
All issues in gin-contrib/static
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100