Reddit links are no longer previewing
Original report: https://github.com/mattermost/mattermost-server/issues/16665
Reddit links are not previewing any longer.
Steps to reproduce
Attempt to link to a reddit post in Mattermost.
A preview box should appear when linking to a reddit post.
No preview is displayed.
QA Test Steps
Reddit, Twitter, and other links should show proper link previews
Tested and Passed on v5.35. Closing.
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.
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:
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.
Grooming comment: Harrison to queue up for discussion