From 6e03698235f191dc4fe54acad2a484ac25dd7cdf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 4 Apr 2021 21:41:55 +0100 Subject: [PATCH] Strip header --- httpsig.py | 2 +- tests.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/httpsig.py b/httpsig.py index fca42310c..07fe4c449 100644 --- a/httpsig.py +++ b/httpsig.py @@ -180,7 +180,7 @@ def signPostHeadersNew(dateStr: str, privateKeyPem: str, } signatureHeader = '; '.join( [f'{k}=:{v}:' for k, v in signatureDict.items()]) - return signatureIndexHeader, signatureHeader + return signatureIndexHeader.strip(), signatureHeader def createSignedHeader(privateKeyPem: str, nickname: str, diff --git a/tests.py b/tests.py index b136c224d..46d513f90 100644 --- a/tests.py +++ b/tests.py @@ -274,8 +274,6 @@ def testHttpSigNew(): if signatureIndexHeader != expectedIndexHeader: print('Unexpected new http header: ' + signatureIndexHeader) print('Should be: ' + expectedIndexHeader) - if signatureIndexHeader.strip() != expectedIndexHeader: - print('stripped match') assert signatureIndexHeader == expectedIndexHeader assert signatureHeader == \ 'sig1=:LQU1PcJILSp1Q30GWINusfftYYKfTtam7InSu2c+ZzfGC' + \