raiseSignatureVerificationError,'Mastodon requires the Date header or (created) pseudo-header to be signed'unlesssigned_headers.include?('date')||signed_headers.include?('(created)')
raiseSignatureVerificationError,'Mastodon requires the Digest header or (request-target) pseudo-header to be signed'unlesssigned_headers.include?(Request::REQUEST_TARGET)||signed_headers.include?('digest')
raiseSignatureVerificationError,'Mastodon requires the Digest header or (request-target) pseudo-header to be signed'unlesssigned_headers.include?(HttpSignatureDraft::REQUEST_TARGET)||signed_headers.include?('digest')
raiseSignatureVerificationError,'Mastodon requires the Host header to be signed when doing a GET request'ifrequest.get?&&!signed_headers.include?('host')
raiseSignatureVerificationError,'Mastodon requires the Digest header to be signed when doing a POST request'ifrequest.post?&&!signed_headers.include?('digest')
# We have lost some headers in the process, so don't sign the new
# request, in order to avoid issuing a valid signature with fewer
# conditions than expected.
defsigned_headers
@headers.without('User-Agent','Accept-Encoding')
end
Rails.logger.warn{"Some headers (#{@headers.keys-signed_headers.keys}) have been lost on redirect from {@uri} to #{request.uri}, this should not happen. Skipping signatures"}