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/http: RFC 6874 cleanup not done on NewRequest* methods #62235

Closed
RemiBou opened this issue Aug 23, 2023 · 3 comments
Closed

net/http: RFC 6874 cleanup not done on NewRequest* methods #62235

RemiBou opened this issue Aug 23, 2023 · 3 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@RemiBou
Copy link

RemiBou commented Aug 23, 2023

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

go 1.21

Does this issue reproduce with the latest release?

yes

What did you do?

func main() {
	_, err := http.NewRequest("GET", "http://[::1%lo0]:8080", nil)
	if err != nil {
		fmt.Printf("Error: %v", err)
	} else {
		fmt.Printf("OK")
	}
}

https://go.dev/play/p/oVgxggDoViJ

What did you expect to see?

"OK" displayed and request created with hostname "[::1]" like it would have been with
This was implemented in #9544 by @mikioh

What did you see instead?

Error: parse "http://[::1%lo0]:8080": invalid URL escape "%lo"
@bcmills
Copy link
Contributor

bcmills commented Aug 23, 2023

(CC @neild)

@RemiBou, do you want to send a CL to implement this?
(I recommend the Gerrit-based workflow from https://go.dev/doc/contribute.)

@bcmills bcmills added this to the Backlog milestone Aug 23, 2023
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 23, 2023
@neild
Copy link
Contributor

neild commented Aug 23, 2023

The % needs to be percent-encoded, so the URL should be http://[::1%25lo0]:8080.

RFC 6874:

According to URI syntax [RFC3986], "%" is always treated as
an escape character in a URI, so, according to the established URI
syntax [RFC3986] any occurrences of literal "%" symbols in a URI MUST
be percent-encoded and represented in the form "%25". Thus, the
scoped address fe80::a%en1 would appear in a URI as
http://[fe80::a%25en1].

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 23, 2023
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants