-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
No check of length of parameter values #1531
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
Comments
This should be fixed with PR #1535 |
It seems the split between the names, values and the maxIndex is still causing problems. I encountered problems before as described in this issue #1258 This is my middleware: // DecodeURIPath is a echo middleware that decodes path parameters
func DecodeURIPath(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
newValues := make([]string, len(c.ParamValues()))
for i, value := range c.ParamValues() {
path, err := url.PathUnescape(value)
if err != nil {
path = value
}
newValues[i] = path
}
c.SetParamValues(newValues...)
return next(c)
}
} During execution However, After calling Then the during the next request
|
FYI: adding the line: c.SetParamNames(c.ParamNames()...) Seems to fix my problem by resetting the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
A comment just to annoy out stale-bot and giving the echo team a bit of extra time to look at this problem :) |
We had the same issues in our tests where we are using
We are using a simple workaround in our test helpers now. Calling Example: // Workaround required for echo v4.1.17, see GitHub #1531
h.Ctx.SetParamNames("")
h.Ctx.SetParamValues("")
h.Ctx.Reset(req, rec) I will try to work out a PR to cleanup the param value handling and avoid the current pitfalls |
PR #1659 has been merged addressing the symptoms so echo should not panic anymore. |
Issue Description
Checklist
Working code to debug
Version/commit
echo/context.go
Line 316 in fc4b1c0
The text was updated successfully, but these errors were encountered: