From 4de50ddfc3ef09ddc0a56c8ff9bf2429df524aa5 Mon Sep 17 00:00:00 2001 From: Declan Freeman-Gleason Date: Thu, 5 Jul 2018 06:45:08 -0700 Subject: 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. --- app/post.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/post.go') diff --git a/app/post.go b/app/post.go index e24018995..806263f5f 100644 --- a/app/post.go +++ b/app/post.go @@ -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 } -- cgit v1.2.3-1-g7c22