diff options
author | Declan Freeman-Gleason <pietroglyph@users.noreply.github.com> | 2018-07-05 06:45:08 -0700 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2018-07-05 09:45:08 -0400 |
commit | 4de50ddfc3ef09ddc0a56c8ff9bf2429df524aa5 (patch) | |
tree | 44342dd269ff9d224e576c0f3bb1d68839f522a3 | |
parent | 6299af0fa54a9cd658e0d7fb1e5552746830cebf (diff) | |
download | chat-4de50ddfc3ef09ddc0a56c8ff9bf2429df524aa5.tar.gz chat-4de50ddfc3ef09ddc0a56c8ff9bf2429df524aa5.tar.bz2 chat-4de50ddfc3ef09ddc0a56c8ff9bf2429df524aa5.zip |
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.
-rw-r--r-- | app/post.go | 5 |
1 files changed, 5 insertions, 0 deletions
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 } |