mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 23:23:48 +08:00
fix: wrong baseURL if open window twice (#3273)
This commit is contained in:
parent
b8537d1c96
commit
a9c22f0588
@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Fix replace line in `go.mod` to use relative paths. Fixes Windows paths with spaces - @leaanthony.
|
- Fix replace line in `go.mod` to use relative paths. Fixes Windows paths with spaces - @leaanthony.
|
||||||
- Fix MacOS systray click handling when no attached window by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3207](https://github.com/wailsapp/wails/pull/3207)
|
- Fix MacOS systray click handling when no attached window by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3207](https://github.com/wailsapp/wails/pull/3207)
|
||||||
- Fix failing Windows build due to unknown option by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3208](https://github.com/wailsapp/wails/pull/3208)
|
- Fix failing Windows build due to unknown option by [thomas-senechal](https://github.com/thomas-senechal) in PR [#3208](https://github.com/wailsapp/wails/pull/3208)
|
||||||
|
- Fix wrong baseURL when open window twice by @5aaee9 in PR [#3273](https://github.com/wailsapp/wails/pull/3273)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -160,8 +159,7 @@ func GetStartURL(userURL string) (string, error) {
|
|||||||
return "", fmt.Errorf("Error parsing URL: " + err.Error())
|
return "", fmt.Errorf("Error parsing URL: " + err.Error())
|
||||||
}
|
}
|
||||||
if parsedURL.Scheme == "" {
|
if parsedURL.Scheme == "" {
|
||||||
baseURL.Path = path.Join(baseURL.Path, userURL)
|
startURL = baseURL.ResolveReference(&url.URL{Path: userURL}).String()
|
||||||
startURL = baseURL.String()
|
|
||||||
// if the original URL had a trailing slash, add it back
|
// if the original URL had a trailing slash, add it back
|
||||||
if strings.HasSuffix(userURL, "/") && !strings.HasSuffix(startURL, "/") {
|
if strings.HasSuffix(userURL, "/") && !strings.HasSuffix(startURL, "/") {
|
||||||
startURL = startURL + "/"
|
startURL = startURL + "/"
|
||||||
|
Loading…
Reference in New Issue
Block a user