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

Former-commit-id: 51ba15f84c
This commit is contained in:
Hayden 2023-11-15 20:51:19 -06:00 committed by GitHub
parent ba2e66a014
commit 13c437c418

View file

@ -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
}