Update download URLs in viewer handlers to use the correct domain

This commit is contained in:
Leon Bösche
2026-01-10 03:04:29 +01:00
parent 6a3a2f6701
commit 687c7a5a61

View File

@@ -379,7 +379,7 @@ func viewerHandler(w http.ResponseWriter, r *http.Request, db *database.DB, audi
db.LogActivity(r.Context(), userID, orgID, &fileId, "view_file", map[string]interface{}{})
// Build download URL - using full path for frontend to fetch with auth headers
viewUrl := fmt.Sprintf("https://b0esche.cloud/api/orgs/%s/files/download?path=%s", orgID.String(), file.Path)
viewUrl := fmt.Sprintf("https://go.b0esche.cloud/orgs/%s/files/download?path=%s", orgID.String(), file.Path)
// Determine if it's a PDF based on file extension
isPdf := strings.HasSuffix(strings.ToLower(file.Name), ".pdf")
@@ -430,7 +430,7 @@ func userViewerHandler(w http.ResponseWriter, r *http.Request, db *database.DB,
db.LogActivity(r.Context(), userID, uuid.Nil, &fileId, "view_user_file", map[string]interface{}{})
// Build download URL for user files - using full path for frontend to fetch with auth headers
viewUrl := fmt.Sprintf("https://b0esche.cloud/api/user/files/download?path=%s", file.Path)
viewUrl := fmt.Sprintf("https://go.b0esche.cloud/user/files/download?path=%s", file.Path)
// Determine if it's a PDF based on file extension
isPdf := strings.HasSuffix(strings.ToLower(file.Name), ".pdf")