Skip to content

Commit

Permalink
Keep basePaths unmodified.
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW authored and daveshanley committed Mar 26, 2024
1 parent 8c0c19f commit 29ed98d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions paths/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ func checkPathAgainstBase(docPath, urlPath string, basePaths []string) bool {
if docPath == urlPath {
return true
}
for i := range basePaths {
if basePaths[i][len(basePaths[i])-1] == '/' {
basePaths[i] = basePaths[i][:len(basePaths[i])-1]
for _, basePath := range basePaths {
if basePath[len(basePath)-1] == '/' {
basePath = basePath[:len(basePath)-1]
}
merged := fmt.Sprintf("%s%s", basePaths[i], urlPath)
merged := fmt.Sprintf("%s%s", basePath, urlPath)
if docPath == merged {
return true
}
Expand Down

0 comments on commit 29ed98d

Please sign in to comment.