utterances icon indicating copy to clipboard operation
utterances copied to clipboard

Fix client.ts for encoded uris

Open jnooree opened this issue 3 years ago • 3 comments

Some url related variables could contain already encoded URIs. This PR will decode such strings to prevent double encoding of URIs.

jnooree avatar Jul 18 '22 08:07 jnooree

I clearly understand the intent, but the implementation seems to be a bit dirty: it unconditionally runs all this strings through decoder, which may result in unintended consequences.

galaxy4public avatar Oct 12 '25 09:10 galaxy4public

This repo doesn’t seem to be maintained, so I’m not very interested in improving this PR.

That said, do you have any ideas for addressing the issue? It’s a general problem with user-facing URL formatting, not just in this context.

jnooree avatar Oct 13 '25 10:10 jnooree

I do have a working fork of this, perhaps I will start maintaining it since the idea is great. With your question though, I did not put enough effort to think about possible sollutions, but generally, I am skeptical of blunt application of a transformation. I think the data need to be sanitized before it enters the system and stored in a predictable format, then you can apply expected conversions when you retrieve the data from storage (here, storage is anything that stores the data, even if it is a variable). Let's postpone this discussion until I am ready to maintain the fork and we will get to this PR :)

galaxy4public avatar Oct 15 '25 05:10 galaxy4public