fedi http headers should be PascalCase
This commit is contained in:
parent
957a222f96
commit
8f38223284
2 changed files with 4 additions and 4 deletions
|
@ -46,8 +46,8 @@ class Inbox(object):
|
|||
now = email.utils.formatdate(timeval=None, localtime=False, usegmt=True)
|
||||
parts = urllib.parse.urlparse(self._url)
|
||||
headers = [
|
||||
["host", parts.netloc],
|
||||
["date", now]
|
||||
["Host", parts.netloc],
|
||||
["Date", now]
|
||||
]
|
||||
sign_headers = headers[:]
|
||||
sign_headers.insert(0, ["(request-target)", "post %s" % parts.path])
|
||||
|
|
|
@ -23,9 +23,9 @@ class PrivateKey(object):
|
|||
|
||||
def signature(key: PrivateKey, headers: typing.List[typing.Tuple[str, str]]
|
||||
) -> str:
|
||||
sign_header_keys = " ".join(h[0] for h in headers)
|
||||
sign_header_keys = " ".join(h[0].lower() for h in headers)
|
||||
|
||||
sign_string_parts = ["%s: %s" % (k, v) for k, v in headers]
|
||||
sign_string_parts = ["%s: %s" % (k.lower(), v) for k, v in headers]
|
||||
sign_string = "\n".join(sign_string_parts)
|
||||
|
||||
signature = key.key.sign(
|
||||
|
|
Loading…
Reference in a new issue