Browse Source

Change HTTP Signature verification status from 401 to 503 on temporary failure to get remote actor (#37221)

pull/1371/head
Claire 3 months ago committed by Misty De Meo
parent
commit
c3383350a4
No known key found for this signature in database
GPG Key ID: 76CF846A2F674B2C
  1. 3
      app/controllers/concerns/signature_verification.rb

3
app/controllers/concerns/signature_verification.rb

@ -72,10 +72,13 @@ module SignatureVerification
rescue Mastodon::SignatureVerificationError => e
fail_with! e.message
rescue *Mastodon::HTTP_CONNECTION_ERRORS => e
@signature_verification_failure_code ||= 503
fail_with! "Failed to fetch remote data: #{e.message}"
rescue Mastodon::UnexpectedResponseError
@signature_verification_failure_code ||= 503
fail_with! 'Failed to fetch remote data (got unexpected reply from server)'
rescue Stoplight::Error::RedLight
@signature_verification_failure_code ||= 503
fail_with! 'Fetching attempt skipped because of recent connection failure'
end

Loading…
Cancel
Save