From 9db278205bf7db5dbaefd6adf5d63806f960c428 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Sat, 25 Jan 2020 05:50:30 -0500 Subject: [PATCH] ensure content-length is a string --- automation/roles/mitmproxy/files/bubble_modify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automation/roles/mitmproxy/files/bubble_modify.py b/automation/roles/mitmproxy/files/bubble_modify.py index 5cc714b6..cffd17ca 100644 --- a/automation/roles/mitmproxy/files/bubble_modify.py +++ b/automation/roles/mitmproxy/files/bubble_modify.py @@ -68,7 +68,8 @@ def responseheaders(flow): if flow.request.method == 'GET': response = requests.get(uri, headers=headers) elif flow.request.method == 'POST': - headers['Content-Length'] = len(flow.request.content) + bubble_log('responseheaders: special bubble request: POST content is '+str(flow.request.content)) + headers['Content-Length'] = str(len(flow.request.content)) response = requests.post(uri, data=flow.request.content, headers=headers) else: bubble_log('responseheaders: special bubble request: method '+flow.request.method+' not supported')