fix: incorrect api if not set site_url (6c2f348)

pull/3556/head
Andy Hsu 2023-02-21 19:57:50 +08:00
parent 50579fef84
commit 8655e33e60
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ func GetApiUrl(r *http.Request) string {
if strings.HasPrefix(api, "http") {
return api
}
if r != nil && api == "" {
if r != nil {
protocol := "http"
if r.TLS != nil || r.Header.Get("X-Forwarded-Proto") == "https" {
protocol = "https"