fix: ensure urls isn't encoded (#618)

This commit is contained in:
Hayden 2023-11-15 20:51:19 -06:00 committed by GitHub
parent b408318acb
commit 51ba15f84c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ import (
"image/png" "image/png"
"io" "io"
"net/http" "net/http"
"net/url"
"github.com/hay-kot/homebox/backend/internal/web/adapters" "github.com/hay-kot/homebox/backend/internal/web/adapters"
"github.com/hay-kot/httpkit/errchain" "github.com/hay-kot/httpkit/errchain"
@ -43,7 +44,12 @@ func (ctrl *V1Controller) HandleGenerateQRCode() errchain.HandlerFunc {
panic(err) 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 { if err != nil {
return err return err
} }