Closed adamharrison closed 3 months ago
Unfortunately there are different standards for URL encoding. For consistency reasons I will not be changing the default one that comes with Lapis. Since it's been in use for so long, changing it may break utilities that depend on the output of it. (eg. if you depend on a certain version of URL encoding to generate signatures for signed content)
That's fair, I suppose.
These days,
URLSearchParams.toString()
can be used to create query parameter strings client side.This method encodes space (
`) as
+, rather than
%20`.Lapis currently uses
socket.url.unescape
to unescape the query string; this function inluasocket
explicitly mentions that this is for hexadecimal encoding only, so the+
isn't unescaped.Given that this seems to be the default behavior for the browser, and is a part of the spec (though I think it is optional); would it make sense to replace "+" with "%20" before we call unescape?
(And let me know if you'd like me to open a PR).