Skip to content
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 should document difference #62306

Closed
ghost opened this issue Aug 27, 2023 · 2 comments
Closed

net/url: PathEscape should document difference #62306

ghost opened this issue Aug 27, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 27, 2023

this prints true true, as expected:

package main

import "net/url"

func main() {
   println(
      url.PathEscape(" ") == "%20",
      url.QueryEscape(" ") == "+",
   )
}

so ideally, the documentation should reflect this difference. it does for Unescape:

PathUnescape is identical to QueryUnescape except that it does not unescape '+' to ' ' (space).

https://godocs.io/net/url#PathUnescape

but not Escape.

@ghost ghost added the Proposal label Aug 27, 2023
@seankhliao
Copy link
Member

I don't think there's anything to document, PathEscape follows the same rule for spaces as everything else (%XX).
QueryEscape does not guarantee which transformations it makes, there are many possible ones, only that the output is safe.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2023
@ghost
Copy link
Author

ghost commented Aug 27, 2023

OK, but couldn't we document what you just said? nothing in your comment is currently documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants