From 0074bf3b70ca3a539d9a89b00d290d83abe90a82 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Fri, 26 Feb 2021 01:15:29 +0000 Subject: [PATCH] [Trivial] Assign value after the encode In the previous fix [1] the value of pubkey.encode() was forgotten to be assigned which basically makes it a noop operation. This patch fixes that. [1] https://review.opendev.org/c/osf/refstack/+/776168 Change-Id: I93a4e5d8afde7e3abfdcf66220c64cda111d4a48 --- refstack/api/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refstack/api/validators.py b/refstack/api/validators.py index 3150fa84..016085c0 100644 --- a/refstack/api/validators.py +++ b/refstack/api/validators.py @@ -128,7 +128,7 @@ class TestResultValidator(BaseValidator): try: pubkey = request.headers.get('X-Public-Key', '') try: - pubkey.encode('utf-8') + pubkey = pubkey.encode('utf-8') except AttributeError: # it's already in bytes pass