From 066eba35ae10f231ada37cc034b61580a20cdae5 Mon Sep 17 00:00:00 2001 From: 5aaee9 <7685264+5aaee9@users.noreply.github.com> Date: Thu, 22 Feb 2024 21:03:01 +0800 Subject: [PATCH] fix: wrong baseURL if open window twice --- v3/internal/assetserver/assetserver.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/v3/internal/assetserver/assetserver.go b/v3/internal/assetserver/assetserver.go index 4acddcddf3e..0d80007e763 100644 --- a/v3/internal/assetserver/assetserver.go +++ b/v3/internal/assetserver/assetserver.go @@ -7,7 +7,6 @@ import ( "net/http" "net/http/httptest" "net/url" - "path" "strings" "time" ) @@ -160,8 +159,7 @@ func GetStartURL(userURL string) (string, error) { return "", fmt.Errorf("Error parsing URL: " + err.Error()) } if parsedURL.Scheme == "" { - baseURL.Path = path.Join(baseURL.Path, userURL) - startURL = baseURL.String() + startURL = baseURL.ResolveReference(&url.URL{Path: userURL}).String() // if the original URL had a trailing slash, add it back if strings.HasSuffix(userURL, "/") && !strings.HasSuffix(startURL, "/") { startURL = startURL + "/"