hug icon indicating copy to clipboard operation
hug copied to clipboard

parse_body=False could pass body

Open davidhyman opened this issue 7 years ago • 1 comments

https://github.com/timothycrosley/hug/blob/a0a1ec83d0bbc43bebc64eb3b645297db35619d7/hug/interface.py#L539-L550

Forgive the pun - on using parse_body=False, we are sent body forced to None, whereas I think I expected it to be the result of request.stream/request.stream.read(), without any additional parsing.

The relevant test won't pick up on it as it's checking for None.

Thoughts? Happy to send a PR

davidhyman avatar Dec 05 '17 14:12 davidhyman

I think there's a bug here: https://github.com/hugapi/hug/blob/32183bc054a659db187c7947123246563ac88275/hug/interface.py#L562

Should probably be: self.parse_body = route.get('parse_body', True)

silverspringhusker avatar Apr 17 '19 23:04 silverspringhusker