diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/middleware.py | 13 | ||||
-rw-r--r-- | core/signatures.py | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/core/middleware.py b/core/middleware.py new file mode 100644 index 0000000..8e95f06 --- /dev/null +++ b/core/middleware.py @@ -0,0 +1,13 @@ +class AlwaysSecureMiddleware: + """ + Locks the request object as always being secure, for when it's behind + a HTTPS reverse proxy. + """ + + def __init__(self, get_response): + self.get_response = get_response + + def __call__(self, request): + request.__class__.scheme = "https" + response = self.get_response(request) + return response diff --git a/core/signatures.py b/core/signatures.py index 6f4d9ef..805ae91 100644 --- a/core/signatures.py +++ b/core/signatures.py @@ -96,7 +96,7 @@ class HttpSignature: ) headers["Signature"] = self.compile_signature( { - "keyid": identity.urls.key.full(), # type:ignore + "keyid": identity.key_id, "headers": list(headers.keys()), "signature": identity.sign(signed_string), "algorithm": "rsa-sha256", |