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 fbd40b0 commit 2a03263Copy full SHA for 2a03263
requests/validate_request.go
@@ -33,12 +33,16 @@ func ValidateRequestSchema(
33
34
var validationErrors []*errors.ValidationError
35
36
- requestBody, _ := io.ReadAll(request.Body)
+ var requestBody []byte
37
+ if request != nil && request.Body != nil {
38
+ requestBody, _ = io.ReadAll(request.Body)
39
- // close the request body, so it can be re-read later by another player in the chain
- _ = request.Body.Close()
40
- request.Body = io.NopCloser(bytes.NewBuffer(requestBody))
+ // close the request body, so it can be re-read later by another player in the chain
41
+ _ = request.Body.Close()
42
+ request.Body = io.NopCloser(bytes.NewBuffer(requestBody))
43
44
+ }
45
+
46
var decodedObj interface{}
47
48
if len(requestBody) > 0 {
0 commit comments