working commit

This commit is contained in:
2026-02-15 18:47:43 +02:00
parent c5454acb05
commit b76ea1a9ac
3 changed files with 93 additions and 7 deletions
+4 -4
View File
@@ -86,9 +86,9 @@ func (rctx *Context) GetContext() context.Context {
const emptyJSON = "{}"
func (ctx *Context) BindJSON(obj any) error {
func (rctx *Context) BindJSON(obj any) error {
buffer := bytes.NewBuffer(nil)
_, err := io.Copy(buffer, ctx.Request.Body)
_, err := io.Copy(buffer, rctx.Request.Body)
if err != nil {
return err
}
@@ -103,9 +103,9 @@ func (ctx *Context) BindJSON(obj any) error {
return err
}
func (ctx *Context) BindQuery(obj any) error {
func (rctx *Context) BindQuery(obj any) error {
qMap := make(map[string]string)
for key, val := range ctx.Request.URL.Query() {
for key, val := range rctx.Request.URL.Query() {
if len(val) == 1 {
qMap[key] = val[0]
}