2
0

Better error response to malformed headers (#35278)

This commit is contained in:
David Roetzel
2025-07-08 11:31:04 +02:00
committed by Claire
parent 388e09e1a3
commit 333a17a478
4 changed files with 30 additions and 0 deletions

View File

@@ -196,6 +196,8 @@ class SignedRequest
return if body_digest == received_digest
raise Mastodon::SignatureVerificationError, "Invalid Digest value. Computed SHA-256 digest: #{body_digest}; given: #{received_digest}"
rescue Starry::ParseError
raise Mastodon::MalformedHeaderError, 'Content-Digest could not be parsed. It does not contain a valid RFC8941 dictionary.'
end
def created_time