Skip to content

Commit

Permalink
Retry ActivityPub inbox delivery on HTTP 401 and 408 errors (mastodon…
Browse files Browse the repository at this point in the history
…#10812)

HTTP 401 responses returned by Mastodon's inbox controller may
be temporary if, for instance, the requesting user's actor/key json
could not be retrieved in a timely fashion. This changes allow retries
instead of dropping the message entirely.

Also added HTTP 408 as that error is by nature temporary.
  • Loading branch information
ClearlyClaire authored and multiple creatures committed Nov 19, 2019
1 parent 918b786 commit a8ae1e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/workers/activitypub/delivery_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def response_successful?(response)
end

def response_error_unsalvageable?(response)
(400...500).cover?(response.code) && response.code != 429
(400...500).cover?(response.code) && ![401, 408, 429].include?(response.code)
end

def failure_tracker
Expand Down

0 comments on commit a8ae1e4

Please sign in to comment.