urlencode doesn't escape slashes
See original GitHub issue
Top Results From Across the Web
escaping - slashes in url variables - Stack Overflow
You need to escape those but don't just replace it by %2F manually. You can use URLEncoder for this. Eg URLEncoder.encode(url, "UTF-8"). Then...
Read more >URL-Encoding of "slashes" - Online
Encode slashes to URL-encoded format with various advanced options. Our site has an easy to use online tool to convert your data.
Read more >HTML URL Encoding Reference - W3Schools
Character From Windows‑1252 From UTF‑8
space %20 %20
! %21 %21
" %22 %22
Read more >encodeURIComponent() - JavaScript - MDN Web Docs
The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape ...
Read more >[SOLVED] URL-encoded slash ("/") character does not work
Chars like %2F are invalid in URL paths as defined in RFC 3986 Section 3.3. Why don't you send your search values as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s fair enough but in practice it’s not necessary there either and included credentials are deprecated anyways. Since those are unlikely to be produced within templates it’s an edge case that is not really worth considering.
I hit this issue when trying to create a file in a gitlab repository via API calls. The gitlab api requires the slashes to be encoded. To make this work I do: {{ myvar | urlencode | regex_replace(‘/’,‘%2F’) }}. I’m working with Ansible and Jinja2 filters in my playbook tasks. This could be a workaround for those of you hitting this, as I validated it works.