mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-23 22:29:59 -05:00
correctly handle paths ending in /
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -272,7 +272,11 @@ func (rt Router) regexRouteMatcher(pattern string, target url.URL) bool {
|
||||
}
|
||||
|
||||
func prefixRouteMatcher(prefix string, target url.URL) bool {
|
||||
return strings.HasPrefix(path.Clean(target.Path), prefix) && prefix != "/"
|
||||
cleanTarget := path.Clean(target.Path)
|
||||
if strings.HasSuffix(target.Path, "/") {
|
||||
cleanTarget += "/"
|
||||
}
|
||||
return strings.HasPrefix(cleanTarget, prefix) && prefix != "/"
|
||||
}
|
||||
|
||||
func singleJoiningSlash(a, b string) string {
|
||||
|
||||
Reference in New Issue
Block a user