fluffychat icon indicating copy to clipboard operation
fluffychat copied to clipboard

URIs getting % escaped to %25 even when already escaping a character

Open Sweeistaken opened this issue 3 months ago • 1 comments

Bug Description

When sending a URL with escapes (e.g. https://uploads.swee.codes/swee/Djjaner%20-%20Hyperscan.opus) it gets escaped to https://uploads.swee.codes/swee/Djjaner%2520-%2520Hyperscan.opus which causes a 404.

It seems to escape the link in the HTML part of the message, here's the source of a message I sent:

{
  "content": {
    "body": "https://uploads.swee.codes/swee/Djjaner%20-%20Hyperscan.opus",
    "format": "org.matrix.custom.html",
    "formatted_body": "<a href=\"https://uploads.swee.codes/swee/Djjaner%2520-%2520Hyperscan.opus\">https://uploads.swee.codes/swee/Djjaner%20-%20Hyperscan.opus</a>",
    "msgtype": "m.text"
  },
  "event_id": "REDACTED",
  "origin_server_ts": "REDACTED",
  "room_id": "REDACTED",
  "sender": "@swee:swee.codes",
  "type": "m.room.message",
  "unsigned": {}
}

Steps to Reproduce

Send a message with a link that contains %20

Expected Behavior

Sends the original link regardless of URL escaping (or at least ignores %)

App Version

2.1.1 (F-Droid)

Additional Platform Information

Device: Motorola Moto G 5G - 2024, OS: Android 15

Additional Context

No response

Sweeistaken avatar Sep 17 '25 01:09 Sweeistaken

Probably related to this, i had the same issue working on my client: https://github.com/dart-lang/tools/issues/2169

Airyzz avatar Sep 27 '25 00:09 Airyzz