[bug] Static directory routes fail silently on creation
clarencefoy opened this issue · comments
Describe the bug
Let's assume I am creating a few static directory handlers, like /staticdir and then /staticdir2 or even /staticdirtwo, then the second and third route will never be registered and there is no error message. These are serving different directories, not sure that matters.
If, for whatever reason, I start with /staticdir6 for example, then I can seemingly register any smaller numbers but not higher numbers, so /staticdir5 will be fine, but /staticdir7 will not.
Versions
Go version: go1.15.5 linux/amd64
package version: v1.7.4-0.20191024121256-f395758b854c
Steps to Reproduce
Take three different directories and serve them as static dirs. Use any name /example and then add a number, like /example2 for the second directory + route and then do another directory + route, using, for example, /exampletwo.
Expected behavior
I had expected any route using a different word to firstly be registered as a new route, and, or, if there was an error, to tell me why this route is not being registered at all. Maybe some kind of warning to say that routes must never match for the first number of characters?
Code Snippets
err = pws.r.PathPrefix("/example").Handler(http.StripPrefix("/example", http.FileServer(http.Dir(localDirToBeServed)))).GetError()
if err != nil {
//handle error
}```
```err = pws.r.PathPrefix("/example2").Handler(http.StripPrefix("/example2", http.FileServer(http.Dir(localDirToBeServed)))).GetError()
if err != nil {
//handle error
}```
This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days.