Mastodon: Do not normalize URI with Unicode NFKC in Request

Created on 21 Nov 2018  Â·  5Comments  Â·  Source: tootsuite/mastodon

Request#perform internally normalizes the URI. So HTTP request may not be sent to the actual URL. For example, if the URI is https://en.wiktionary.org/wiki/â‘ , a request will be sent to https://en.wiktionary.org/wiki/1.

I was able to reproduce this bug with preview card. https://testingmstdn.abcang.net/@abcang/101108536036779897

Related: #4837

bug

Most helpful comment

For example the custom emoji with file names like the following toot, it can not be displayed on other instances.
https://edge.taruntarun.net/@mayaeh/101108940463390306
https://edge.taruntarun.net/media_files/mstdn_edge/custom_emojis/images/000/000/795/original/%E2%91%A0.png

Normalization changes the URL to an incorrect one, so it will not be registered as the custom emoji on other instances.

It can see from the sender, but can not see from the recipient.

All 5 comments

For example the custom emoji with file names like the following toot, it can not be displayed on other instances.
https://edge.taruntarun.net/@mayaeh/101108940463390306
https://edge.taruntarun.net/media_files/mstdn_edge/custom_emojis/images/000/000/795/original/%E2%91%A0.png

Normalization changes the URL to an incorrect one, so it will not be registered as the custom emoji on other instances.

It can see from the sender, but can not see from the recipient.

is this a problem on 2.6.1 stable?

It is confirmed with the stable version of v2.5.2 and v2.6.1. This bug probably exists from v1.5 that the Request class was implemented.

I tried it only on the master, but it also happens between the pawoo.net and master.

Turns out HTTP.rb is normalizing URLs regardless of what our Request class does:

https://github.com/httprb/http/blob/5181b230e848c8b5b36a7dcbfbd2b14abe675b46/lib/http/request.rb#L217-L227

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SelfsameSynonym picture SelfsameSynonym  Â·  96Comments

sturmen picture sturmen  Â·  67Comments

inmysocks picture inmysocks  Â·  128Comments

miguelpeixe picture miguelpeixe  Â·  61Comments

alex73630 picture alex73630  Â·  56Comments