You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When placing app.Static before any app.Use middleware, the middleware functions execute twice. This causes unexpected behavior and redundancy in middleware execution.
Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
the cause is the current design, as your api function and the function for the static files are on the same route
since we wanted to make it possible to use the middlewares after executing the static delivery, we also executed a next there, which probably leads to this effect
if necessary, you could see if you could implement a different behavior for mismatch
this design has been reworked for version 3 and should work better there
Bug Description
When placing app.Static before any app.Use middleware, the middleware functions execute twice. This causes unexpected behavior and redundancy in middleware execution.
However, if app.Static is placed after the first middleware, the middleware functions execute as expected.
How to Reproduce
Steps to reproduce the behavior:
Expected Behavior
The middleware functions should execute once.
Fiber Version
v2.52.5
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: