about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authortakayamaki <fsgiko@gmail.com>2018-05-19 21:47:44 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-05-19 14:47:44 +0200
commit587da93152aa68f4ebe3285155aea5642f517d40 (patch)
tree75ebb1817234fb2394da61cca48bd7ca2cda91c5 /app
parent4b94e9c65efd227c58f8be9b3db6b667d403ed3c (diff)
checking http status code with range (#7544)
Diffstat (limited to 'app')
-rw-r--r--app/workers/activitypub/delivery_worker.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/activitypub/delivery_worker.rb b/app/workers/activitypub/delivery_worker.rb
index 9b278eb72..323a9f85b 100644
--- a/app/workers/activitypub/delivery_worker.rb
+++ b/app/workers/activitypub/delivery_worker.rb
@@ -44,11 +44,11 @@ class ActivityPub::DeliveryWorker
   end
 
   def response_successful?(response)
-    response.code > 199 && response.code < 300
+    (200...300).cover?(response.code)
   end
 
   def response_error_unsalvageable?(response)
-    response.code > 399 && response.code < 500 && response.code != 429
+    (400...500).cover?(response.code) && response.code != 429
   end
 
   def failure_tracker