Update CORS handling for web image viewing and adjust host assignment in publicFileShareHandler

This commit is contained in:
Leon Bösche
2026-01-25 20:06:38 +01:00
parent ce29077e8c
commit ad882ae509
3 changed files with 7 additions and 4 deletions

Binary file not shown.

View File

@@ -2952,7 +2952,10 @@ func publicFileShareHandler(w http.ResponseWriter, r *http.Request, db *database
} else if r.TLS == nil {
scheme = "http"
}
host := "www.b0esche.cloud"
host := r.Host
if host == "" {
host = "go.b0esche.cloud"
}
downloadPath := fmt.Sprintf("%s://%s/public/share/%s/download?token=%s", scheme, host, token, url.QueryEscape(viewerToken))
viewPath := fmt.Sprintf("%s://%s/public/share/%s/view?token=%s", scheme, host, token, url.QueryEscape(viewerToken))