Ensure signature code doesn't crash on (request-target) signature

environments/review-front-340-9n9j9v/deployments/3368
Eliot Berriot 2019-11-27 13:54:21 +01:00
rodzic 89bbb902a4
commit 3224f07253
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6B501DFD73514E14
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -67,6 +67,9 @@ def verify_django(django_request, public_key):
expected = signature_headers.split(" ")
logger.debug("Signature expected headers: %s", expected)
for header in expected:
if header == "(request-target)":
# this one represent the request body, so not an actual HTTP header
continue
try:
headers[header]
except KeyError: