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

Feature request: Add ability to completely rewrite media URLs #266

Closed
hashworks opened this issue Sep 24, 2023 · 1 comment · Fixed by #267
Closed

Feature request: Add ability to completely rewrite media URLs #266

hashworks opened this issue Sep 24, 2023 · 1 comment · Fixed by #267

Comments

@hashworks
Copy link
Contributor

I try to hide the matrix bridge from IRC users as much as possible. However, sending attachments breaks the illusion atm, since it is a matrix URL:
https://example.net/_matrix/media/r0/download/example.net/dbWPYNbBQVdkWqCVWZzvFADD/foo.jpg

While I can adjust the domain with MEDIA_URL, the rest remains unchanged. It would be great if one could provide a template that adjusts https://github.com/hifi/heisenbridge/blob/master/heisenbridge/__main__.py#L343. The default would be:

https:/${MEDIA_URL}/_matrix/media/r0/download/${NETLOC}${PATH}${FILENAME}

With a properly configured reverse proxy one could reduce it to:

https:/irc.example.net/${PATH}${FILENAME}

Which would result in:

https://irc.example.net/dbWPYNbBQVdkWqCVWZzvFADD/foo.jpg

This would work since the netloc never changes with the bridge.

@hashworks
Copy link
Contributor Author

hashworks commented Sep 24, 2023

I think this would help with #257, since ATM one needs to adjust the reverse proxy to Content-Disposition: inline anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant