From dfb5c2b3ce576b006b326c617e86bee1e225f811 Mon Sep 17 00:00:00 2001 From: zachmann <gabriel.zachmann@kit.edu> Date: Tue, 7 Jun 2022 10:21:20 +0200 Subject: [PATCH] fix using x-www-from-urlencoding on revocation endpoint --- CHANGELOG.md | 1 + internal/endpoints/revocation/revocationEndpoint.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a4701a..82dd1b01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ ### Bugfixes - Fixed a bug where mytokens could not be used with x-www-form-urlencoding +- Fixed a bug where `x-www-form-urlencoding` was not accepted on token revocation endpoint ### Dependencies diff --git a/internal/endpoints/revocation/revocationEndpoint.go b/internal/endpoints/revocation/revocationEndpoint.go index a99725d5..da5de7f0 100644 --- a/internal/endpoints/revocation/revocationEndpoint.go +++ b/internal/endpoints/revocation/revocationEndpoint.go @@ -1,7 +1,6 @@ package revocation import ( - "encoding/json" "time" "github.com/gofiber/fiber/v2" @@ -28,7 +27,7 @@ func HandleRevoke(ctx *fiber.Ctx) error { rlog := logger.GetRequestLogger(ctx) rlog.Debug("Handle revocation request") req := api.RevocationRequest{} - if err := json.Unmarshal(ctx.Body(), &req); err != nil { + if err := ctx.BodyParser(&req); err != nil { return model.ErrorToBadRequestErrorResponse(err).Send(ctx) } rlog.Trace("Parsed mytoken request") -- GitLab