matrix-org / matrix.to

A simple stateless privacy-protecting URL redirecting service for Matrix
http://matrix.to
Apache License 2.0
932 stars 199 forks source link

Query parameters like ?utm_source=gitter make matrix.to link to the wrong room #254

Closed SethFalco closed 2 years ago

SethFalco commented 2 years ago

Describe the bug When query parameters are included in the link to matrix.to, matrix.to references to the wrong chat room address.

For example, on the following page: https://gitter.im/editorconfig/editorconfig-vscode

The URL to matrix.to is: https://matrix.to/#/#editorconfig_editorconfig-vscode:gitter.im?utm_source=gitter

Once clicked, Matrix.to changes it to: https://matrix.to/#/#editorconfig_editorconfig-vscode:gitter.im#/#editorconfig_editorconfig-vscode:gitter.im

And attempts to join the user to: #editorconfig_editorconfig-vscode:gitter.im# ← Note the extra # at the end

To Reproduce Steps to reproduce the behavior:

  1. Navigate to a gitter room: https://gitter.im/editorconfig/editorconfig-vscode
  2. Click on "Chat via Matrix"
  3. See that Matrix.to changes the URL from https://matrix.to/#/#editorconfig_editorconfig-vscode:gitter.im?utm_source=gitter to https://matrix.to/#/#editorconfig_editorconfig-vscode:gitter.im#/#editorconfig_editorconfig-vscode:gitter.im

Expected behavior I would expect to be joining the room #editorconfig_editorconfig-vscode:gitter.im instead of #editorconfig_editorconfig-vscode:gitter.im# (which is an invalid room anyway).

Screenshots image

Desktop (please complete the following information):

SethFalco commented 2 years ago

This appears to no longer be reproducible. Not sure if it was by the latest commit, or perhaps the Firefox update as I'm now on Firefox Nightly 98.

Regardless, I'll close this for now and reopen it if the issue occurs again.