3 Commits

Author SHA1 Message Date
tueem 4993d6e05d Merge pull request 'Fix scheme determination behind reverse proxies' (#23) from fix/mixed into dev
build / Go-Build (push) Successful in 1m27s
Reviewed-on: #23
2026-05-31 11:16:43 +00:00
tueem 8906cd9678 fix(download): fix scheme determination behind reverse proxies
build / Go-Build (push) Successful in 1m29s
build / Go-Build (pull_request) Successful in 1m30s
2026-05-31 13:12:57 +02:00
tueem e05aa849c7 Merge pull request 'Add frontend' (#20) from feat/frontend into dev
build / Go-Build (push) Successful in 1m28s
docker / docker (push) Successful in 5m38s
Reviewed-on: #20
2026-05-28 20:37:53 +00:00
+13 -4
View File
@@ -104,9 +104,18 @@ func getPublicUrl(r *http.Request, subpath string) string {
Host: r.Host, Host: r.Host,
Path: path.Join("public", subpath), Path: path.Join("public", subpath),
} }
newURL.Scheme = "http" newURL.Scheme = determineScheme(r)
if r.TLS != nil {
newURL.Scheme = "https"
}
return newURL.String() return newURL.String()
} }
func determineScheme(r *http.Request) string {
if proto := r.Header.Get("X-Forwarded-Proto"); proto != "" {
return proto
}
if r.TLS != nil {
return "https"
}
return "http"
}