New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/url: PathEscape and PathUnescape functions #13737
Comments
I mailed with r.w.johnstone off list about this, and for his application he only needs to escape path elements to use when building URLs. For that, QueryEscape works fine, and is what other existing code uses as far as I know. Maybe instead of new API we should document that fact. |
There are a few places where QueryEscape doesn't quite work. Notably, spaces are to be encoded as "%20", instead of "+", when used in paths. |
@jmhodges, fair enough. Want to send a change? |
Yeah, was trying to pawn it off on a friend but he didn't bite. |
So, I'm digging in here and trying to figure out how far to take this. I've come up with 4 options I could implement but none of them are super satisfying. We have the concept of The first option is to create a special mode called A second option is to teach the places calling A third option is for The last option I came up with is for I'm pretty torn on these 4 options. Does anyone have a preference or alternative idea? |
I'm leaning toward the third, but having a |
I'm also fine with you creating an entirely new set of functions not reusing anything that's currently existing. That might even be safest for now. Write sufficient tests and we can refactor later. I have a plan to create a new shared package |
Yeah, I'm on it. Option 3 for now because I'm not feeling sassy enough. Oh man, a |
CL https://golang.org/cl/31322 mentions this issue. |
Should we add PathEscape and PathUnescape functions, similar to QueryEscape and QueryUnescape? The functionality is already present (see func (*URL) EscapedPath), but it is awkward to use.
See https://groups.google.com/forum/#!topic/golang-dev/UDUqvuKrq14 for golang-dev discussion
The text was updated successfully, but these errors were encountered: