From 92a2f0116194c6d209a81a90dfb199e908e04117 Mon Sep 17 00:00:00 2001 From: sturman <4456572+sturman@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:46:35 +0300 Subject: [PATCH] fix: fix `x-www-form-urlencoded` header name --- jwt.go | 2 +- jwt_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jwt.go b/jwt.go index 98760ab..15f1e57 100644 --- a/jwt.go +++ b/jwt.go @@ -771,7 +771,7 @@ func toOPAPayload(request *http.Request, includeBody bool) (*Payload, error) { if err != nil { return nil, err } - } else if contentType == "application/x-www-url-formencoded" { + } else if contentType == "application/x-www-form-urlencoded" { input.Form, err = url.ParseQuery(string(save)) if err != nil { return nil, err diff --git a/jwt_test.go b/jwt_test.go index ecfed79..53c5813 100644 --- a/jwt_test.go +++ b/jwt_test.go @@ -179,7 +179,7 @@ func TestServeOPAWithBody(t *testing.T) { { name: "form", method: "POST", - contentType: "application/x-www-url-formencoded", + contentType: "application/x-www-form-urlencoded", body: `foo=bar&bar=foo`, allowed: true, expectedForm: map[string][]string{