From 69aed6a332232de3cb2007f2eeea9ea6238f1cda Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 25 Aug 2025 21:20:40 +0200 Subject: [PATCH] refactor(proxy): remove usage of fmt There is no need to use the heavy machinery (fmt) when we can simply use string concatenation instead. --- internal/ui/proxy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ui/proxy.go b/internal/ui/proxy.go index 8e9ee787..c167e418 100644 --- a/internal/ui/proxy.go +++ b/internal/ui/proxy.go @@ -8,11 +8,11 @@ import ( "crypto/sha256" "encoding/base64" "errors" - "fmt" "log/slog" "net/http" "net/url" "path" + "strconv" "time" "miniflux.app/v2/internal/config" @@ -128,7 +128,7 @@ func (h *handler) mediaProxy(w http.ResponseWriter, r *http.Request) { ) // Forward the status code from the origin. - http.Error(w, fmt.Sprintf("Origin status code is %d", resp.StatusCode), resp.StatusCode) + http.Error(w, "Origin status code is "+strconv.Itoa(resp.StatusCode), resp.StatusCode) return } @@ -140,7 +140,7 @@ func (h *handler) mediaProxy(w http.ResponseWriter, r *http.Request) { b.WithHeader("Content-Type", resp.Header.Get("Content-Type")) if filename := path.Base(parsedMediaURL.Path); filename != "" { - b.WithHeader("Content-Disposition", fmt.Sprintf(`inline; filename="%s"`, filename)) + b.WithHeader("Content-Disposition", `inline; filename="`+filename+`"`) } forwardedResponseHeader := [...]string{"Content-Encoding", "Content-Type", "Content-Length", "Accept-Ranges", "Content-Range"}