AuthenticatedUrlHelper: Rescue URI::InvalidURIError
This error should usually nto happen, but we catch it just to be safe.
This commit is contained in:
@ -92,6 +92,8 @@ module AuthenticatedUrlHelper
|
|||||||
|
|
||||||
# Return the full URL
|
# Return the full URL
|
||||||
parsed_url.to_s
|
parsed_url.to_s
|
||||||
|
rescue URI::InvalidURIError
|
||||||
|
url
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_query_parameters(url, parameters)
|
def remove_query_parameters(url, parameters)
|
||||||
@ -106,6 +108,8 @@ module AuthenticatedUrlHelper
|
|||||||
|
|
||||||
# Return the full URL and removed parameters
|
# Return the full URL and removed parameters
|
||||||
[parsed_url.to_s, removed_params.symbolize_keys]
|
[parsed_url.to_s, removed_params.symbolize_keys]
|
||||||
|
rescue URI::InvalidURIError
|
||||||
|
[url, {}]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user