From 39e98a3e90664f8eac14d4dedc36481d69ba16e9 Mon Sep 17 00:00:00 2001 From: RXWatcher <14085001+RXWatcher@users.noreply.github.com> Date: Sun, 24 May 2026 08:57:42 +0200 Subject: [PATCH] fix(api): allow HEAD on /api/v1/direct-download Firefox (and some download managers) issue a HEAD request before starting a download. The route only registered GET, so HEAD returned 405 Method Not Allowed and the browser aborted the download. Mirrors the pattern already used by /stream/{session_id}, which registers both GET and HEAD on the same handler. ServeDirect is built on http.ServeContent / ServeFile, which natively handle HEAD by writing headers without a body, so no handler changes are needed. Co-Authored-By: Claude Opus 4.7 (1M context) --- internal/api/router.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/api/router.go b/internal/api/router.go index 6b73b108..06b7aae8 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -1547,6 +1547,7 @@ func NewRouter(deps Dependencies) chi.Router { r.Get("/{id}/file", downloadHandler.HandleDownloadFile) }) r.Get("/direct-download", downloadHandler.HandleDirectDownload) + r.Head("/direct-download", downloadHandler.HandleDirectDownload) // Recipe gallery catalog (no profile required — purely static metadata). recipeHandler := &handlers.RecipeHandler{}