You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot get .WithPath to handle URL-encoded value #448
Hi, thanks for report. I can't reproduce it neither in 2.16.0 nor in master.
I've added a couple of tests for this case, all are passing: 97e9161
For me, when I pass url-encoded argument to WithPath, it is added to request path as-is, and then http.Client url-encodes the whole path when sending request. So that piece of the path is actually url-encoded twice when it comes to server. Server url-decodes it, and server handler sees original url-encoded argument.
The error you quoted seems like printf-like formatting was used, but TBH I have no idea when it can be used for URL paths.
Can you provide a minimal reproducible example? Ideally based on master branch.
Activity
Add tests for urlencoded path arg interpolation (#448)
gavv commentedon Mar 3, 2025
Hi, thanks for report. I can't reproduce it neither in 2.16.0 nor in master.
I've added a couple of tests for this case, all are passing: 97e9161
For me, when I pass url-encoded argument to WithPath, it is added to request path as-is, and then http.Client url-encodes the whole path when sending request. So that piece of the path is actually url-encoded twice when it comes to server. Server url-decodes it, and server handler sees original url-encoded argument.
The error you quoted seems like printf-like formatting was used, but TBH I have no idea when it can be used for URL paths.
Can you provide a minimal reproducible example? Ideally based on master branch.