Reddit links are no longer previewing

Description

Original report: https://github.com/mattermost/mattermost-server/issues/16665

Summary
Reddit links are not previewing any longer.

Steps to reproduce
Mattermost 5.30.0
Attempt to link to a reddit post in Mattermost.

Expected behavior
A preview box should appear when linking to a reddit post.

Observed behavior
No preview is displayed.

QA Test Steps

Reddit, Twitter, and other links should show proper link previews

Activity

Show:
Jelena Gilliam
4 days ago

Tested and Passed on v5.35. Closing.

Jelena Gilliam
April 20, 2021, 7:22 PM

Tested and Passed on cloud 2793_9de05bba_c7b05797_ce3a686e.

  • Verified Reddit, Twitter and other various link are previewing as expected.

QA note: Test exists. This ticket will be closed after v5.35 testing.

Eli Young
March 18, 2021, 9:46 PM

Copying a second comment from GitHub:

It turns out we kinda already do this for Twitter links:

I would argue that we should instead make all of such requests use a custom user-agent. This would fix previews on Reddit (and probably additional sites) and would also allow us to get rid of the Twitter special casing:

Eli Young
March 18, 2021, 9:32 PM

Copying my comment from GitHub:

This happens because Reddit filters requests somewhat based on the user-agent, and responds with a stock unavailable response to certain user-agents that it has deemed prone to abuse. This includes the default Golang user-agent.

I would recommend changing the user-agent used by Mattermost to something distinguishable, like Mattermost-Bot/1.0. This works on Reddit:

I would recommend against including the server version in the user agent because an attacker could use that to determine if the deployment has known vulnerabilities.

Dean Whillier
January 19, 2021, 4:31 PM

Grooming comment: Harrison to queue up for discussion

Done
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Mattermost Community

QA Assignee

Jelena Gilliam

Reporter

Amy Blais

Fix versions

Mattermost Team

Web Platform [Messaging]