element-hq / element-hq/element-android
Do not send the fragment part when requesting UrlPreview data
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 917
- PR merge metrics
- No merged PRs in 30d
Description
- Send `https://github.com/vector-im/element-android/pull/3448/files#diff-63b96f47c62869ba88e77317ff6a0b31483a6ebee57f5669c8be0c0eefce5c4aR19` in an unencrypted room.
- Observe that the request `https://matrix-client.matrix.org/_matrix/media/r0/preview_url?url=https%3A%2F%2Fgithub.com%2Fvector-im%2Felement-android%2Fpull%2F3448%2Ffiles%23diff-63b96f47c62869ba88e77317ff6a0b31483a6ebee57f5669c8be0c0eefce5c4aR19` is send to the server.
The fragment part `#diff-63b96f47c62869ba88e77317ff6a0b31483a6ebee57f5669c8be0c0eefce5c4aR19` should not be send to the server.
But the fragment part should be restored when we render the URL preview in the timeline, because the link has definitely not the same value without the fragment part, and the user wants to see the same page when clicking on the preview and when clicking on the link from the message.
Contributor guide
Assessment
This issue has not been assessed yet.