mirror of
https://github.com/mattermost/mattermost.git
synced 2026-11-02 08:43:46 +08:00
* Add field to config model Config option for disabling link previews for given domains. * Refactor functions and corresponding tests * Expand logic for link preview Newly added isLinkAllowedForPreview function determines whether a link should display a preview. It gets corresponding config values consisting of comma separated domain values, normalizes them and checks for matches. * Create tests for link preview restriction * Fix formatting issue * Add test cases where images are expected * Apply suggestions from code review Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> * Apply remaining code suggestions * Add RestrictLinkPreviews value to telemetries Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>