v
v copied to clipboard
path_escape not escaping `:`
Describe the bug
path_escape OR url encoding should escape all special characters that happen in url, including :
Found that it is not escaping :
, but escaping other characters
Expected Behavior
https://play.vlang.io/p/08e93618c1 Refer to https://www.urlencoder.org/ for the correct conversion
Current Behavior
https://play.vlang.io/p/08e93618c1
Reproduction Steps
https://play.vlang.io/p/08e93618c1
Tip: click on the "Test" button to see the expected and actual responses
Possible Solution
No response
Additional Information/Context
No response
V version
V 0.3.2 d62fc77
Environment details (OS name and version, etc.)
MacOs Ventura M1
Please paste your example code directly in the issue. The playground links you gave are no longer valid.
done, I have updated the description with code sample
If you want the : (and a few other things) escaped, you need to call query_escape instead of path_escape.
There are different rules for escaping different parts of a URL.
If you want more detail about exactly what is escaped when, read the comments in vlib/net/urllib/urllib.v
, check RFC3986, etc.