Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
j2rong4cn committed Jun 13, 2024
1 parent 45fdafd commit d84760d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/common/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ func GetApiUrl(r *http.Request) string {
}

func GetApiUrlFromContext(ctx context.Context) string {
var r *http.Request
if c, ok := ctx.(*gin.Context); ok {
r = c.Request
return GetApiUrl(c.Request)
}
return GetApiUrl(r)
return GetApiUrl(nil)
}

0 comments on commit d84760d

Please sign in to comment.