From 107b977cb8fa0df0ca5619c2f9fd9e3e6e5a83a1 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 21 Jun 2017 16:50:03 +0200 Subject: Return raw content of reply when Content-Type is application/octet-stream. Keep returning decoded text for any other Content-Type. --- tools/certtools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/certtools.py b/tools/certtools.py index 5aa2251..cb56a8d 100644 --- a/tools/certtools.py +++ b/tools/certtools.py @@ -328,7 +328,10 @@ def http_request_session(url, data=None, key=None, verifynode=None, params=None, result = session.send(prepared_req, verify=sslparameters.cafile) result.raise_for_status() authheader = result.headers.get('X-Catlfish-Auth') - data = result.text + if result.headers['Content-Type'] == "application/octet-stream": + data = result.content + else: + data = result.text check_auth_header(authheader, verifynode, result.content, url_to_sign) return data -- cgit v1.1