From 13c437c41882a237a763d1c25df5ad93be9b7e46 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:51:19 -0600 Subject: [PATCH] fix: ensure urls isn't encoded (#618) Former-commit-id: 51ba15f84c47026c09c8193767a1492af4ee44f7 --- backend/app/api/handlers/v1/v1_ctrl_qrcode.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/app/api/handlers/v1/v1_ctrl_qrcode.go b/backend/app/api/handlers/v1/v1_ctrl_qrcode.go index a4352df..25f7c75 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_qrcode.go +++ b/backend/app/api/handlers/v1/v1_ctrl_qrcode.go @@ -5,6 +5,7 @@ import ( "image/png" "io" "net/http" + "net/url" "github.com/hay-kot/homebox/backend/internal/web/adapters" "github.com/hay-kot/httpkit/errchain" @@ -43,7 +44,12 @@ func (ctrl *V1Controller) HandleGenerateQRCode() errchain.HandlerFunc { panic(err) } - qrc, err := qrcode.New(q.Data) + decodedStr, err := url.QueryUnescape(q.Data) + if err != nil { + return err + } + + qrc, err := qrcode.New(decodedStr) if err != nil { return err }