matrix-org / matrix-org/matrix-spec

/media/v3/preview_url response spec should include the original value of og:image

Open
#2,312 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

The /media/v3/preview_url endpoint currently returns metadata extracted from a target URL, but it does not expose the original og:image value provided by the remote site. Instead replaces it with the mxc:// link to the image cached by the proxy.

While having mxc:// url is a good idea and it serves a purpose of keeping the user safe, there are quality of life benefits of being able to access the original value - letting the user(if they chose to) quickly directly access the media, that the url is pointing to.

A real life example would be receiving the social media link to a picture. If user clicks on the image, it opens the image directly in their browser (according to the OpenGraph data) - this is how it is done in discord.

Since the og:video property is being provided in the original state, without wrapping it into mxc:// cache link, i think it would be most logical to have 'matrix:image:cached_url' property to pass the cached url (Endpoint already provides "matrix:image:size" property as the proxy's addition to the original OpenGraph tags)

Contributor guide

Open the contributing guide

Research direction

Start with the /media/v3/preview_url response and compare how og:image and og:video are currently represented. Define how the original og:image value should be exposed alongside the cached mxc:// URL, including the proposed matrix:image:cached_url property, then update the response specification and its examples if present.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.