Skip to content

Commit

Permalink
files to os-system step5: fix bugs when os-system-ed
Browse files Browse the repository at this point in the history
  • Loading branch information
lovehunter9 committed Jul 24, 2024
1 parent 0ab4463 commit 19b8392
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gateway/pkg/proxy/backend_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ func rewriteUrl(path string, pvc string, prefix string) string {
klog.Info("firstHalf=", firstHalf)
klog.Info("secondHalf=", secondHalf)

if strings.HasPrefix(secondHalf, "/"+pvc) {
return firstHalf + secondHalf
if strings.HasSuffix(secondHalf, pvc) {
return path
}
if splitName == "/Home" {
return firstHalf + "/" + pvc + secondHalf
Expand All @@ -198,7 +198,7 @@ func rewriteUrl(path string, pvc string, prefix string) string {
} else {
pathSuffix := strings.TrimPrefix(path, prefix)
if strings.HasPrefix(pathSuffix, "/"+pvc) {
return prefix + pathSuffix
return path
}
return prefix + "/" + pvc + pathSuffix
}
Expand Down

0 comments on commit 19b8392

Please sign in to comment.