Skip to content

Commit

Permalink
Fix encode and params
Browse files Browse the repository at this point in the history
  • Loading branch information
tamara-plante committed Jan 14, 2019
1 parent 6a6e9a5 commit 7332cfa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions resources/lib/webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,12 @@ def get_params(self):
''' Get the params
'''
try:
params = dict(urlparse.parse_qsl(self.path[1:]))
path = self.path[1:]

if '?' in path:
path = path.split('?', 1)[1]

params = dict(urlparse.parse_qsl(path))
except Exception:
params = {}

Expand All @@ -161,7 +166,7 @@ def handle_request(self, headers_only=False):
self.send_header('Content-type', 'text/html')
self.send_header('Content-Length', len(path))
self.end_headers()
self.wfile.write(path.encode('utf-8'))
self.wfile.write(path)

except Exception as error:

Expand Down

0 comments on commit 7332cfa

Please sign in to comment.