treeform/puppy

spaces in url

4zv4l opened this issue · 2 comments

4zv4l commented

I have this Nim code in here

import puppy
import os

let
  url = "https://funquizzes.fun/uploads/manga/One%20Punch%20Man/"

echo url
echo execShellCmd("curl "&url)
echo fetch(url)

with curl it works but with puppy it doesn't work because it seems that the fetch function replace spaces or %20 by '+' anyway which the server I try to fetch doesn't accept.
Anything I can do about that ?

nnsee commented

For context:

Spaces should never be encoded as + in URL paths, as defined by RFC 3986 - they should always be encoded as %20. Any + in a path is to be interpreted literally, and not as a space.

Spaces can be encoded both as + and as %20 in query parameters and values (everything after a ? in an URL), as that has the content type application/x-www-form-urlencoded, which defines the + encoding. Only the query part of an URL is application/x-www-form-urlencoded.

Thank you for the issue!

This should be fixed in 1.5.5.

Feel free to reopen if you still have issues.