Commit 4de50ddf authored by Declan Freeman-Gleason's avatar Declan Freeman-Gleason Committed by Harrison Healey

MM-10603: Ignore Redirects and Other Changes when Displaying Link Previews (#9025)

* Don't use redirected URL in link preview.

* Only show preview if OG data is provided.
parent 6299af0f
......@@ -765,6 +765,11 @@ func (a *App) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph {
makeOpenGraphURLsAbsolute(og, requestURL)
// The URL should be the link the user provided in their message, not a redirected one.
if og.URL != "" {
og.URL = requestURL
return og
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment