Skip to content

Commit 675efa9

Browse files
committed
bug in request handler
1 parent 92b515f commit 675efa9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pypulse/Socket/request_handler.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pypulse import View
44
from pypulse.Template import Template
55
from pypulse.Utils import execute_ast_view_request
6-
6+
import urllib.parse
77

88
class RequestHandler(http.server.SimpleHTTPRequestHandler):
99
def __init__(self, *args, **kwargs):
@@ -40,12 +40,11 @@ def do_GET(self):
4040

4141
def do_POST(self):
4242
content_length = int(self.headers['Content-Length'])
43-
post_body = self.rfile.read(content_length)
43+
post_body = urllib.parse.parse_qs(self.rfile.read(content_length).decode('utf-8'))
4444
temp_post_body = {}
45-
for i in post_body.decode('utf-8').split('&'):
46-
element = i.split('=')
47-
if len(element) == 2:
48-
temp_post_body[element[0]] = element[1]
45+
46+
for i in post_body:
47+
temp_post_body[i] = post_body[i][0]
4948

5049
current_view = View.CallView(self.path)
5150

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
setup(
1010
name='python-pulse',
1111
packages=find_packages(),
12-
version='0.1.5',
12+
version='0.1.6',
1313
description='Python, create desktop applications based on Chromium',
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)