Skip to content

Commit

Permalink
fix bug when end event is already emitted on a GET request without Co…
Browse files Browse the repository at this point in the history
…ntent-Type header
  • Loading branch information
Filirom1 committed Mar 27, 2013
1 parent bf93098 commit 1dbb626
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/validator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ validate = (req, path, specs, next) ->
)

return process() if req.is('json') or req.is('application/x-www-form-urlencoded') or req.is('multipart/form-data')

# do not try body parsing if there is no body to parse
return process() if req.method in ['GET', 'DELETE']

# body parsing, if incoming request is not json, multipart or form-urlencoded
# by default, no body
delete req.body
Expand Down

0 comments on commit 1dbb626

Please sign in to comment.