treeform / puppy

Puppy fetches via HTTP and HTTPS
MIT License
184 stars 27 forks source link

=, in url escaped #100

Closed lightcax closed 5 months ago

lightcax commented 1 year ago

https://www.**.com/list=1,2 it seems that the fetch function replace https://www.**.com/list%3D1%2C2 resulting in a url access error, can it be unescaped?

lightcax commented 1 year ago
proc path*(url: Url): string =
  ## Returns the paths combined into a single path string.
  ## @["foo", "bar"] -> "/foo/bar"
  if url.paths.len > 0:
    for part in url.paths:
      result.add '/'
      result.add encodeURIComponent(part)

Is it possible to add an optional parameter not encodeURIComponent or not escaped or to exclude =, from encodeURIComponent

treeform commented 1 year ago

Thank you for the bug report! You have the correct behavior, we will fix ours to match soon.

guzba commented 5 months ago

This is fixed in release 2.1.2. Feel free to re-open if things are still not working as expected.