Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
read input only in get
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Aug 12, 2019
1 parent 170e9e6 commit 385b08a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def __init__(self, level=DEFAULT, msg='', data=[]):
httpcode = self.get_code(level)
headers = {'Content-Type': 'application/json'}
message = self.get_message(level)
params = web.input() if web.input() else web.data()
if web.ctx.env.get('REQUEST_METHOD', '') == 'GET':
params = web.input()
else:
params = web.data().decode('utf-8')
output = json.dumps(
self.make_output(httpcode, message, msg, params, data))

Expand Down

0 comments on commit 385b08a

Please sign in to comment.