mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
ipn/ipnlocal: move LocalBackend.validPopBrowserURL empty check from caller
I was too late with review feedback to 513780f4f8
.
Updates tailscale/corp#7948
Change-Id: I8fa3b4eba4efaff591a2d0bfe6ab4795638b7c3a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
513780f4f8
commit
1b56acf513
@ -1728,11 +1728,11 @@ func (b *LocalBackend) popBrowserAuthNow() {
|
||||
|
||||
// validPopBrowserURL reports whether urlStr is a valid value for a
|
||||
// control server to send in a *URL field.
|
||||
//
|
||||
// b.mu must *not* be held.
|
||||
func (b *LocalBackend) validPopBrowserURL(urlStr string) bool {
|
||||
if urlStr == "" {
|
||||
// Common case.
|
||||
return true
|
||||
return false
|
||||
}
|
||||
u, err := url.Parse(urlStr)
|
||||
if err != nil {
|
||||
@ -1753,7 +1753,7 @@ func (b *LocalBackend) validPopBrowserURL(urlStr string) bool {
|
||||
}
|
||||
|
||||
func (b *LocalBackend) tellClientToBrowseToURL(url string) {
|
||||
if url != "" && b.validPopBrowserURL(url) {
|
||||
if b.validPopBrowserURL(url) {
|
||||
b.send(ipn.Notify{BrowseToURL: &url})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user