I am a bit puzzled by this myself. If for some reasons I would like to encode any valid url into valid pathname, say, to be used on an image proxy with an url structure like:
http://image-proxy/hash_of_url/encoded_url
Is there an efficient way to achieve encoded_url
in javascript? I am on node.js runtime.
I need to do this because it would be used by another proxy not in my control, which had problem with an url like this:
http://image-proxy/hash_of_url/?url=encoded_url
PS: hash_of_url
is a hmac digest of original url, to ensure url is generated by server, but that's not important to my question.