working commit
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user