We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The issue referenced in #276 is not really fixed by the commit that was merged in.
There is still a panic here
go-restful/web_service.go
Line 190 in 1e8c63c
RemoveRoute()
You can reproduce the issue with this code:
func main() { ws := new(WebService) ws.SetDynamicRoutes(true) ws.Route("GET", "/some/path") ws.RemoveRoute("/some/path/that/does/not/exist", "GET") ws.Routes() }
I created a go playground that reproduces the issue here: https://play.golang.org/p/SYUMGQeY0cU
Changing RemoveRoute() to this fixes the issue:
func (w *WebService) RemoveRoute(path, method string) error { if !w.dynamicRoutes { return errors.New("dynamic routes are not enabled.") } w.routesLock.Lock() defer w.routesLock.Unlock() newRoutes := make([]Route, 0) for ix := range w.routes { if w.routes[ix].Method == method && w.routes[ix].Path == path { continue } newRoutes = append(newRoutes, w.routes[ix]) } w.routes = newRoutes return nil }
The text was updated successfully, but these errors were encountered:
I created a PR which includes the suggested fix here: #472
Sorry, something went wrong.
thank you reporting this and providing a fix using the PR. I will review the changes and merge on approval.
Fixed in PR #472.
No branches or pull requests
The issue referenced in #276 is not really fixed by the commit that was merged in.
There is still a panic here
go-restful/web_service.go
Line 190 in 1e8c63c
RemoveRoute()
with a route that is not in w.routes.You can reproduce the issue with this code:
I created a go playground that reproduces the issue here: https://play.golang.org/p/SYUMGQeY0cU
Changing
RemoveRoute()
to this fixes the issue:The text was updated successfully, but these errors were encountered: