From ef2e7b7d1b943beae1447037477bf99cad076dba Mon Sep 17 00:00:00 2001 From: Antti Leinonen Date: Tue, 8 Oct 2024 10:41:50 +0300 Subject: [PATCH] Use 504 gateway timeout for rack-timeout errors --- app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ea090aef..4e307cb1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -43,11 +43,11 @@ class ApplicationController < ActionController::Base end rescue_from Rack::Timeout::RequestTimeoutException do |exception| - respond_with_error('Request timed out', 503, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error + respond_with_error('Request timed out', 504, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error end rescue_from Rack::Timeout::RequestTimeoutError do |exception| - respond_with_error('Request timed out', 503, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error + respond_with_error('Request timed out', 504, exception) # status code 408 would be the correct status code, but when receiving 408 Firefox retries 10 times and then states the connection was reset instead of showing our error end before_action :set_default_url_options