Skip to content

Commit

Permalink
feat: fix panic when url.Parse() fails to parse URL (casdoor#2034)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinoholo0807 authored Jul 3, 2023
1 parent 30a14ff commit 35e1f85
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func UrlJoin(base string, path string) string {

func GetUrlPath(urlString string) string {
u, _ := url.Parse(urlString)
if u == nil {
return ""
}
return u.Path
}

Expand Down

0 comments on commit 35e1f85

Please sign in to comment.