feat: remove url.JoinPath() to be compatible with Go 1.17 (#1995)

This commit is contained in:
Xinhao Yuan 2023-06-20 17:44:40 +08:00 committed by GitHub
parent 926e73ed1b
commit f6f4d44444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,9 +18,9 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"net/http" "net/http"
"net/url"
"strings" "strings"
"github.com/casdoor/casdoor/util"
"golang.org/x/net/html" "golang.org/x/net/html"
) )
@ -206,10 +206,7 @@ func getFaviconFileBuffer(client *http.Client, email string) (*bytes.Buffer, str
} }
if !strings.HasPrefix(faviconUrl, "http") { if !strings.HasPrefix(faviconUrl, "http") {
faviconUrl, err = url.JoinPath(htmlUrl, faviconUrl) faviconUrl = util.UrlJoin(htmlUrl, faviconUrl)
if err != nil {
return nil, "", err
}
} }
} }