Bug fix (payload escaping in XML payloads)

This commit is contained in:
Miroslav Stampar
2019-11-14 11:49:30 +01:00
parent 8d608dfdfe
commit 2bb5ba7fa2
3 changed files with 3 additions and 3 deletions

View File

@@ -103,7 +103,7 @@ class ReqHandler(BaseHTTPRequestHandler):
if self.data.startswith('{') and self.data.endswith('}'):
params.update(json.loads(self.data))
elif self.data.startswith('<') and self.data.endswith('>'):
params.update(dict(re.findall(r'name="([^"]+)" value="([^"]*)"', self.data)))
params.update(dict((_[0], _[1].replace("&apos;", "'").replace("&quot;", '"').replace("&lt;", '<').replace("&gt;", '>').replace("&amp;", '&')) for _ in re.findall(r'name="([^"]+)" value="([^"]*)"', self.data)))
else:
params.update(parse_qs(self.data))