mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't error out when trying to retrieve title and URL won't encode (#24660)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user