summaryrefslogtreecommitdiff
path: root/src/appMain/sample_policy_manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/appMain/sample_policy_manager.py')
-rw-r--r--src/appMain/sample_policy_manager.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/appMain/sample_policy_manager.py b/src/appMain/sample_policy_manager.py
index 75a04685ed..2b3f835c57 100644
--- a/src/appMain/sample_policy_manager.py
+++ b/src/appMain/sample_policy_manager.py
@@ -25,12 +25,17 @@ parser.add_argument("--encryption", action="store_true",
def http_header(data):
+# The Content-Length to be sent in the HTTP Request header should be
+# adjusted for additional escape characters added for newline strings
+# The mobile proxy will remove the escape characters after receiving this request.
+ content_length = len(data) - data.count('\\')
+
header = {}
header["HTTPRequest"] = {}
header["HTTPRequest"]["headers"] = {
"ConnectTimeout": 60,
"ContentType": "application/json",
- "Content-Length": len(data),
+ "Content-Length": content_length,
"DoInput": True,
"DoOutput": True,
"InstanceFollowRedirects": False,