FIX: Don't error out when trying to retrieve title and URL won't encode (#24660)

This commit is contained in:
Ted Johansson
2023-12-01 15:03:06 +08:00
committed by GitHub
parent aadc104817
commit 54e813e964
4 changed files with 23 additions and 2 deletions

View File

@@ -10,6 +10,8 @@ require "url_helper"
class FinalDestination
class SSRFError < SocketError
end
class UrlEncodingError < ArgumentError
end
MAX_REQUEST_TIME_SECONDS = 10
MAX_REQUEST_SIZE_BYTES = 5_242_880 # 1024 * 1024 * 5
@@ -457,6 +459,8 @@ class FinalDestination
def normalized_url
UrlHelper.normalized_encode(@url)
rescue ArgumentError => e
raise UrlEncodingError, e.message
end
def log(log_level, message)