Better treating of numeric values (Issue #49)

This commit is contained in:
Miroslav Stampar
2012-10-04 16:08:37 +02:00
parent 31aa9be1c7
commit 84b05e2d18
3 changed files with 11 additions and 4 deletions

View File

@@ -588,7 +588,10 @@ class Connect:
# with their HTML encoded counterparts
payload = payload.replace('>', "&gt;").replace('<', "&lt;")
elif kb.postHint == POST_HINT.JSON:
payload = json.dumps(payload)[1:-1]
if payload.startswith('"') and payload.endswith('"'):
payload = json.dumps(payload[1:-1])
else:
payload = json.dumps(payload)[1:-1]
value = agent.replacePayload(value, payload)
else: