mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
feat: add local file system storage provider (#224)
Signed-off-by: sh1luo <690898835@qq.com>
This commit is contained in:
@ -29,10 +29,6 @@ func FileExist(path string) bool {
|
||||
}
|
||||
|
||||
func UrlJoin(base string, path string) string {
|
||||
if !strings.HasPrefix(base, "http://") && !strings.HasPrefix(base, "https://") {
|
||||
base = fmt.Sprintf("https://%s", base)
|
||||
}
|
||||
|
||||
res := fmt.Sprintf("%s/%s", strings.TrimRight(base, "/"), strings.TrimLeft(path, "/"))
|
||||
return res
|
||||
}
|
||||
@ -41,3 +37,8 @@ func GetUrlPath(urlString string) string {
|
||||
u, _ := url.Parse(urlString)
|
||||
return u.Path
|
||||
}
|
||||
|
||||
func GetUrlHost(urlString string) string {
|
||||
u, _ := url.Parse(urlString)
|
||||
return fmt.Sprintf("%s://%s", u.Scheme, u.Host)
|
||||
}
|
||||
|
Reference in New Issue
Block a user