mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:21:47 +08:00
FIX: Follow the canonical URL when importing a remote topic. (#14489)
FinalDestination now supports the `follow_canonical` option, which will perform an initial GET request, parse the canonical link if present, and perform a HEAD request to it. We use this mode during embeds to avoid treating URLs with different query parameters as different topics.
This commit is contained in:
@ -113,7 +113,8 @@ class TopicEmbed < ActiveRecord::Base
|
||||
fd = FinalDestination.new(
|
||||
url,
|
||||
validate_uri: true,
|
||||
max_redirects: 5
|
||||
max_redirects: 5,
|
||||
follow_canonical: true,
|
||||
)
|
||||
|
||||
url = fd.resolve
|
||||
|
Reference in New Issue
Block a user