mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: Do not raise if title cannot be crawled (#16247)
If the crawled page returned an error, `FinalDestination#safe_get` yielded `nil` for `uri` and `chunk` arguments. Another problem is that `get` did not handle the case when `safe_get` failed and did not return the `location` and `set_cookie` headers.
This commit is contained in:
@ -62,6 +62,8 @@ module RetrieveTitle
|
||||
|
||||
fd.get do |_response, chunk, uri|
|
||||
unless Net::HTTPRedirection === _response
|
||||
throw :done if uri.blank?
|
||||
|
||||
if current
|
||||
current << chunk
|
||||
else
|
||||
|
Reference in New Issue
Block a user