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: When I used net/url package ,I met a Bug. #41491

Closed
sober-wang opened this issue Sep 19, 2020 · 1 comment
Closed

net/url: When I used net/url package ,I met a Bug. #41491

sober-wang opened this issue Sep 19, 2020 · 1 comment

Comments

@sober-wang
Copy link

What version of Go are you using (go version)?

$ go version v1.13.5

Does this issue reproduce with the latest release?

Maybe ,this issue reproduce with the latest release.

What did you do?

package main

import (
	"fmt"
	"log"
	"net/url"
)

func main() {
	fmt.Println("vim-go")
	u := "http://admin:FSdf%30g52@192.168.1.1:8888"
	log.Println(u)
	uri, err := url.Parse(u)
	if err != nil {
		fmt.Println("=>", err)
	}
	log.Println(uri)
	URL := uri.String()
	log.Println(URL)
}

If you run this code , the %3 will miss
image

What did you expect to see?

I hope the net/url can clear distinction the correct URI, don't miss something.

@sober-wang sober-wang changed the title Bug: When I used net/url package ,I met a Bug. net/url: When I used net/url package ,I met a Bug. Sep 19, 2020
@ianlancetaylor
Copy link
Contributor

When you want to show plain text, please just paste plain text. Please do not paste an image. Plain text is much easier to read and understand. Thanks.

In a URL %30 means ASCII character 0x30, which is 0. See, for example, https://en.wikipedia.org/wiki/Percent-encoding .

Closing because this is behaving as intended.

@golang golang locked and limited conversation to collaborators Sep 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants