From 29ce1883b69ecfc29b5e8f2acbf0cf7838e1877e Mon Sep 17 00:00:00 2001 From: Mia Sinek Date: Fri, 15 Nov 2024 12:55:03 +0100 Subject: [PATCH] Normalize HTTP status ranges for consistency --- lib/userlist/push/client.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/userlist/push/client.rb b/lib/userlist/push/client.rb index 53688be..da592fe 100644 --- a/lib/userlist/push/client.rb +++ b/lib/userlist/push/client.rb @@ -11,8 +11,8 @@ class Client HTTP_STATUS = { ok: (200..299), server_error: (500..599), - timeout: 408, - rate_limit: 429 + timeout: 408..408, + rate_limit: 429..429 }.freeze def initialize(config = {}) @@ -102,7 +102,7 @@ def error_message_for_status(status) end def status_type(status) - HTTP_STATUS.find { |type, range| range === status }&.first + HTTP_STATUS.find { |_type, range| range.include?(status) }&.first end def error_mapping