We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d19e730 commit adc6184Copy full SHA for adc6184
pkg/httputil/query.go
@@ -4,7 +4,7 @@ import (
4
"bytes"
5
"encoding/json"
6
"errors"
7
- "io/ioutil"
+ "io"
8
"net/http"
9
"net/url"
10
"reflect"
@@ -44,8 +44,8 @@ func GetURLFields(url *url.URL, filter any) []any {
44
// be called before any of gin's c.*Bind methods.
45
func GetBodyFields(c *gin.Context, resource any) ([]any, error) {
46
// Copy the body to be able to use it multiple times
47
- body, _ := ioutil.ReadAll(c.Request.Body)
48
- c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
+ body, _ := io.ReadAll(c.Request.Body)
+ c.Request.Body = io.NopCloser(bytes.NewBuffer(body))
49
50
// Parse the body into a map to have all fields available
51
var mapBody map[string]any
0 commit comments