mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
FIX: Gracefully handle DNS issued from SSRF lookup when inline oneboxing (#19631)
There is an issue where chat message processing breaks due to unhandles `SocketError` exceptions originating in the SSRF check, specifically in `FinalDestination::Resolver`. This change gives `FinalDestination::SSRFDetector` a new error class to wrap the `SocketError` in, and haves the `RetrieveTitle` class handle that error gracefully.
This commit is contained in:
@ -9,7 +9,7 @@ module RetrieveTitle
|
||||
max_redirects: max_redirects,
|
||||
initial_https_redirect_ignore_limit: initial_https_redirect_ignore_limit
|
||||
)
|
||||
rescue Net::ReadTimeout
|
||||
rescue Net::ReadTimeout, FinalDestination::SSRFDetector::LookupFailedError
|
||||
# do nothing for Net::ReadTimeout errors
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user