mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-22 22:10:36 +00:00
fix: generate valid urls when app url contains a trailing slash (#257)
This commit is contained in:
@@ -40,6 +40,15 @@ func GetHostnameFromURL(rawURL string) string {
|
||||
return parsedURL.Hostname()
|
||||
}
|
||||
|
||||
// Returns an absolute path when provided with a URL (https://test.com) and a path "/.well-known/openid-configuration"
|
||||
func GetAbsoluteURL(baseURL string, path string) string {
|
||||
url, err := url.JoinPath(baseURL, path)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
||||
// StringPointer creates a string pointer from a string value
|
||||
func StringPointer(s string) *string {
|
||||
return &s
|
||||
|
||||
Reference in New Issue
Block a user