From a69ac4c883f1fca6855e6434dbffceb37ad0ecb7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 31 Aug 2021 21:53:53 +0100 Subject: [PATCH] Include accept within non-digest http signature --- httpsig.py | 3 ++- session.py | 2 +- tests.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/httpsig.py b/httpsig.py index 50d897e3c..bbe65b59d 100644 --- a/httpsig.py +++ b/httpsig.py @@ -199,7 +199,8 @@ def createSignedHeader(privateKeyPem: str, nickname: str, headers = { '(request-target)': f'post {path}', 'host': headerDomain, - 'date': dateStr + 'date': dateStr, + 'accept': contentType } signatureHeader = \ signPostHeaders(dateStr, privateKeyPem, nickname, diff --git a/session.py b/session.py index 62a63aa1b..fd997babf 100644 --- a/session.py +++ b/session.py @@ -181,7 +181,7 @@ def _getJsonSigned(session, url: str, domainFull: str, sessionHeaders: {}, print('Signed GET url: ' + url) print('Signed GET httpPrefix: ' + httpPrefix) messageStr = '' - withDigest = True + withDigest = False signatureHeaderJson = \ createSignedHeader(signingPrivateKeyPem, nickname, domain, port, toDomain, toPort, url, httpPrefix, withDigest, diff --git a/tests.py b/tests.py index 310362cfd..969b29f8f 100644 --- a/tests.py +++ b/tests.py @@ -1457,7 +1457,7 @@ def testSharedItemsFederation(): } bobInstanceActorJson = \ getJson(signingPrivateKeyPem, sessionClient, - 'http://' + bobAddress + '/@actor', testHeaders, {}, True, + 'http://' + bobAddress + '/@actor', testHeaders, {}, True, __version__, 'http', 'somedomain.or.other', 10, True) assert bobInstanceActorJson pprint(bobInstanceActorJson)