Revert former beta chnages

This commit is contained in:
Mukhtar Akere
2025-08-30 04:10:18 +01:00
parent aff12c2e4b
commit 85cd37f29b
12 changed files with 115 additions and 137 deletions

View File

@@ -451,15 +451,15 @@ func (h *Handler) handleGet(w http.ResponseWriter, r *http.Request) {
// Handle nginx proxy (X-Accel-Redirect)
if file.content == nil && !file.isRar && h.cache.StreamWithRclone() {
link, err := file.getDownloadLink()
if err != nil || link == nil {
if err != nil || link == "" {
http.Error(w, "Could not fetch download link", http.StatusPreconditionFailed)
return
}
w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", fi.Name()))
w.Header().Set("X-Accel-Redirect", link.DownloadLink)
w.Header().Set("X-Accel-Redirect", link)
w.Header().Set("X-Accel-Buffering", "no")
http.Redirect(w, r, link.DownloadLink, http.StatusFound)
http.Redirect(w, r, link, http.StatusFound)
return
}