Skip to content

Commit

Permalink
add nil check in request body validation (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlozano authored and fenollp committed Jul 29, 2019
1 parent 507456a commit 8785b41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openapi3filter/validate_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func ValidateRequestBody(c context.Context, input *RequestValidationInput, reque
data []byte
)

if req.Body != http.NoBody {
if req.Body != http.NoBody && req.Body != nil {
defer req.Body.Close()
var err error
if data, err = ioutil.ReadAll(req.Body); err != nil {
Expand Down

0 comments on commit 8785b41

Please sign in to comment.