From f22e3b56f1992b1adfe48ed3dd4f455fbd1a05ce Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 4 Oct 2022 14:40:32 +0200 Subject: [PATCH] AuthenticatedUrlHelper: Rescue URI::InvalidURIError This error should usually nto happen, but we catch it just to be safe. --- app/helpers/authenticated_url_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/helpers/authenticated_url_helper.rb b/app/helpers/authenticated_url_helper.rb index 3071a4af..d949f555 100644 --- a/app/helpers/authenticated_url_helper.rb +++ b/app/helpers/authenticated_url_helper.rb @@ -92,6 +92,8 @@ module AuthenticatedUrlHelper # Return the full URL parsed_url.to_s + rescue URI::InvalidURIError + url end def remove_query_parameters(url, parameters) @@ -106,6 +108,8 @@ module AuthenticatedUrlHelper # Return the full URL and removed parameters [parsed_url.to_s, removed_params.symbolize_keys] + rescue URI::InvalidURIError + [url, {}] end end end