Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media redirect target URL gets modified by Element Desktop #1924

Open
syldrathecat opened this issue Oct 16, 2024 · 0 comments
Open

Media redirect target URL gets modified by Element Desktop #1924

syldrathecat opened this issue Oct 16, 2024 · 0 comments
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@syldrathecat
Copy link

syldrathecat commented Oct 16, 2024

This code seems to replace the string /_matrix/media/v3/ in media URLs with /_matrix/client/v1/media/:

url.href = url.href.replace(/\/media\/v3\/(.*)\//, "/client/v1/media/$1/");

This URL modification, however, seems to also apply to the target of HTTP redirects.

It doesn't appear that Element Web has this same behavior.

Since we run matrix-media-repo on a separate domain, without media authentication, we have been using a redirect from https://<synapse>/_matrix/client/v1/media/ to https://<matrix-media-repo>/_matrix/media/v3/.

The target URL being modified by Element Desktop went unnoticed by us until now, when Element Desktop 1.11.81 stopped sending the access token, and highlighted this issue.

(Our intention all along was to redirect to matrix-media-repo's unauthenticated endpoint, but Element Desktop has been rewriting it to the authenticated endpoint)

This URL rewriting behavior is certainly not part of the specification, and our setup doesn't seem that unreasonable. Maybe its inclusion in the code should be reconsidered.

@dosubot dosubot bot added O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

No branches or pull requests

1 participant