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/http: http.NewRequest url escape bug #34492
Comments
Please clarify why you expected the output to be different. |
@mvdan, I think |
Part of your URL is being parsed as a fragment: https://play.golang.org/p/1MMWrNCZJfa If you really want your query to contain hash characters, you should construct the URL manually, or pass them through In the future, for questions, see https://golang.org/wiki/Questions. |
@skynet-core I'm sure if you try it in a browser you'll see this more clearly. |
@DisposaBoy, thank you a lot for your explanation, the problem that I can't change this behavior, because there are othe clients of that API exist (C++,JS(fetch)) and they don't run into issues with query escaping... url.QueryEscape didn't solve my problem because I it doesn't encode |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tried to perform GET request to custom API
See: https://play.golang.org/p/FwW8Krub1Jx
What did you expect to see?
(product_name=crashpad_handler)and(product_desc=crashpad_handler)and(manufacturer=%23%23%23%23)and(product_version=%23%23%23%23)and(file_version=%23%23%23%23)and(executable_path=/users/%23%23%23%23/library/application%20support/code/user/globalstorage/ms-vsliveshare.vsliveshare-audio/electron-4.2.7/dist/electron.app/contents/frameworks/electron%20framework.framework/versions/a/resources/crashpad_handler)and(executable_file=crashpad_handler)and(os_type_id=2)and(is_registry=false)and(md5=2fb75dffaf3b2120eba70796315298ee)and(is_terminal_server=false)and(sha1=7812b592cce8bba94cf6b465553bac3e26f3f332)
What did you see instead?
(product_name=crashpad_handler)and(product_desc=crashpad_handler)and(manufacturer=#%23%23%23)and(product_version=%23%23%23%23)and(file_version=%23%23%23%23)and(executable_path=/users/%23%23%23%23/library/application%20support/code/user/globalstorage/ms-vsliveshare.vsliveshare-audio/electron-4.2.7/dist/electron.app/contents/frameworks/electron%20framework.framework/versions/a/resources/crashpad_handler)and(executable_file=crashpad_handler)and(os_type_id=2)and(is_registry=false)and(md5=2fb75dffaf3b2120eba70796315298ee)and(is_terminal_server=false)and(sha1=7812b592cce8bba94cf6b465553bac3e26f3f332)
The text was updated successfully, but these errors were encountered: