summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2017-06-21 16:50:03 +0200
committerLinus Nordberg <linus@nordu.net>2017-06-21 16:50:03 +0200
commit107b977cb8fa0df0ca5619c2f9fd9e3e6e5a83a1 (patch)
treea414df26c14c403f6974ae8ae55c5cccc270e35d
parent32d66a4cffb03f68319262e982c3309047add01c (diff)
Return raw content of reply when Content-Type is application/octet-stream.
Keep returning decoded text for any other Content-Type.
-rw-r--r--tools/certtools.py5
1 files changed, 4 insertions, 1 deletions
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