fix/headers date RFC 2616 compliant

This commit is contained in:
SouthFox 2023-03-29 01:51:15 +08:00
parent a072d89cad
commit 89f1e8d6e3

View file

@ -96,7 +96,7 @@ class HTTPXSigAuth(httpx.Auth):
bh.update(r.content) bh.update(r.content)
bodydigest = "SHA-256=" + base64.b64encode(bh.digest()).decode("utf-8") bodydigest = "SHA-256=" + base64.b64encode(bh.digest()).decode("utf-8")
date = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S GMT") date = datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT")
r.headers["Date"] = date r.headers["Date"] = date
sigheaders = {} sigheaders = {}
if bodydigest: if bodydigest: