-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔥 Feature: Add ability to restart route handling #1739
Conversation
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
ctx.go
Outdated
@@ -782,6 +782,14 @@ func (c *Ctx) Next() (err error) { | |||
return err | |||
} | |||
|
|||
// Restart request handling instead of going to next handler. This may be usefull | |||
// after changing the request path. Note that handlers might be executed again. | |||
func (c *Ctx) Restart() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use a more descriptive name
at first glance you can not see what should be restarted
maybe RestartRouting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I thought of this as an alternative to return c.Next()
; therefore the shorter name.
thanks for the pull request, had such an idea too |
9a79adf
to
e81e9c6
Compare
@ReneWerner87: I already renamed it to |
oh I had not seen can we rename the test cases too ? -> done with my last commit |
Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
@mtneug please add a PR for the docs repository https://github.com/gofiber/docs |
Sorry I missed that. Will update the docs. |
thx |
* 🔥 Feature: Add ability to restart route handling * Change test names Co-authored-by: RW <rene@gofiber.io>
Please provide enough information so that others can review your pull request:
Adds the ability to restart the route handling e.g. after an internal redirect.
Fixes #1731
Explain the details for making this change. What existing problem does the pull request solve?
The example from #1731 is changed in the following way:
Edit 1: changed method name to
RestartRouting