From f0881c9fd694ce4039a6f1996abb6741026dfa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Wed, 9 Aug 2023 19:35:01 +0200 Subject: [PATCH] v0.0.237 parse application/x-www-form-urlencoded in ginext --- ginext/preContext.go | 8 ++++++++ goextVersion.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ginext/preContext.go b/ginext/preContext.go index 8bc277f..bc6fc33 100644 --- a/ginext/preContext.go +++ b/ginext/preContext.go @@ -92,6 +92,14 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) { Build() return nil, nil, langext.Ptr(Error(err)) } + } else if pctx.ginCtx.ContentType() == "application/x-www-form-urlencoded" { + if err := pctx.ginCtx.ShouldBindWith(pctx.form, binding.Form); err != nil { + err = exerr.Wrap(err, "Failed to read urlencoded-form"). + WithType(exerr.TypeBindFailFormData). + Str("struct_type", fmt.Sprintf("%T", pctx.form)). + Build() + return nil, nil, langext.Ptr(Error(err)) + } } else { err := exerr.New(exerr.TypeBindFailFormData, "missing form body"). Str("struct_type", fmt.Sprintf("%T", pctx.form)). diff --git a/goextVersion.go b/goextVersion.go index 4f0d359..f4d82c7 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.236" +const GoextVersion = "0.0.237" -const GoextVersionTimestamp = "2023-08-09T17:48:06+0200" +const GoextVersionTimestamp = "2023-08-09T19:35:01+0200"