Skip to content

Commit d2e4ea2

Browse files
authored
📝 show how to get the hmac header
1 parent af47708 commit d2e4ea2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ local_response = LocalResponse(request.body())
146146
# local_response = LocalResponse("path/to/my/file.ext")
147147

148148
# Optional: verify the HMAC signature
149-
if not local_response.is_valid_hmac_signature(my_secret_key, "some signature"):
150-
raise Error("Invalid HMAC signature!")
149+
# You'll need to get the "X-Mindee-Hmac-Signature" custom HTTP header.
150+
hmac_signature = request.headers.get("X-Mindee-Hmac-Signature")
151+
if not local_response.is_valid_hmac_signature(my_secret_key, hmac_signature):
152+
raise Error("Bad HMAC signature! Is someone trying to do evil?")
151153

152154
# Deserialize the response
153155

0 commit comments

Comments
 (0)