-
Notifications
You must be signed in to change notification settings - Fork 18k
net/url: regression after #22907 fixed #27302
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
Comments
gin web framework also have same question. thanks! |
See the example code and test result from travis func TestQuery(t *testing.T) {
u, err := url.Parse("http://bing.com/search?q=dotnet")
if err != nil {
t.Fatal(err)
}
if u.RawQuery != "q=dotnet" {
t.Error("RawQuery error")
}
u, err = url.Parse("http://bing.com/search?k=v&id=main&id=omit&array[]=first&array[]=second&ids[i]=111&ids[j]=3.14")
if err != nil {
t.Fatal(err)
}
if u.RawQuery != "k=v&id=main&id=omit&array[]=first&array[]=second&ids[i]=111&ids[j]=3.14" {
log.Println(u.RawQuery)
t.Error("RawQuery error")
}
log.Println(u.Query())
} |
Well, according to RFC 3986 https://tools.ietf.org/html/rfc3986#section-3.4, a fragment can only contain pchar, which allows sub-delims, not gen-delims. So, as I understand, a |
@agnivade Although rfc does not include gen-delims, however real-world clients often accept this. |
It seems like we should roll back that CL. This has to keep working (with UTF8 value).
|
Change https://golang.org/cl/137716 mentions this issue: |
@rsc Thank you. |
golang team revert the net/url issue: golang/go#27302
golang team revert the net/url issue: golang/go#27302
golang team revert the net/url issue: golang/go#27302
Change https://golang.org/cl/159157 mentions this issue: |
This is a more conservative version of the reverted CL 99135 (which was reverted in CL 137716) The net/url part rejects URLs with ASCII CTLs from being parsed and the net/http part rejects writing them if a bogus url.URL is constructed otherwise. Updates #27302 Updates #22907 Change-Id: I09a2212eb74c63db575223277aec363c55421ed8 Reviewed-on: https://go-review.googlesource.com/c/159157 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Filippo Valsorda <[email protected]>
Change https://golang.org/cl/159478 mentions this issue: |
Change https://golang.org/cl/160178 mentions this issue: |
CL 159157 was doing UTF-8 decoding of URLs. URLs aren't really UTF-8, even if sometimes they are in some contexts. Instead, only reject ASCII CTLs. Updates #27302 Updates #22907 Change-Id: Ibd64efa5d3a93263d175aadf1c9f87deb4670c62 Reviewed-on: https://go-review.googlesource.com/c/160178 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Change https://golang.org/cl/160678 mentions this issue: |
Change https://golang.org/cl/160798 mentions this issue: |
…in URLs Cherry pick of combined CL 159157 + CL 160178. Fixes #29923 Updates #27302 Updates #22907 Change-Id: I6de92c14284595a58321a4b4d53229285979b872 Reviewed-on: https://go-review.googlesource.com/c/160798 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
…in URLs Cherry pick of combined CL 159157 + CL 160178. Fixes #29922 Updates #27302 Updates #22907 Change-Id: I6de92c14284595a58321a4b4d53229285979b872 Reviewed-on: https://go-review.googlesource.com/c/160678 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Change https://golang.org/cl/162960 mentions this issue: |
Change https://golang.org/cl/162826 mentions this issue: |
Updates #27302 Updates #22907 Change-Id: Iac6957f3517265dfb9c662efb7af31192e3bfd6c Reviewed-on: https://go-review.googlesource.com/c/162960 Reviewed-by: Ian Lance Taylor <[email protected]>
…ing ASCII CTLs Updates #27302 Updates #22907 Change-Id: Iac6957f3517265dfb9c662efb7af31192e3bfd6c Reviewed-on: https://go-review.googlesource.com/c/162960 Reviewed-by: Ian Lance Taylor <[email protected]> (cherry picked from commit ef454fd) Reviewed-on: https://go-review.googlesource.com/c/162826
CL 159157 was doing UTF-8 decoding of URLs. URLs aren't really UTF-8, even if sometimes they are in some contexts. Instead, only reject ASCII CTLs. Updates golang#27302 Updates golang#22907 Change-Id: Ibd64efa5d3a93263d175aadf1c9f87deb4670c62 Reviewed-on: https://go-review.googlesource.com/c/160178 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Updates golang#27302 Updates golang#22907 Change-Id: Iac6957f3517265dfb9c662efb7af31192e3bfd6c Reviewed-on: https://go-review.googlesource.com/c/162960 Reviewed-by: Ian Lance Taylor <[email protected]>
CL 159157 was doing UTF-8 decoding of URLs. URLs aren't really UTF-8, even if sometimes they are in some contexts. Instead, only reject ASCII CTLs. Updates golang#27302 Updates golang#22907 Change-Id: Ibd64efa5d3a93263d175aadf1c9f87deb4670c62 Reviewed-on: https://go-review.googlesource.com/c/160178 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Updates golang#27302 Updates golang#22907 Change-Id: Iac6957f3517265dfb9c662efb7af31192e3bfd6c Reviewed-on: https://go-review.googlesource.com/c/162960 Reviewed-by: Ian Lance Taylor <[email protected]>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/bScfUelhUmE
What did you expect to see?
What did you see instead?
Many javascript framework, like jquery, will append
[]
to param keys, in current and previous stable release, this works fine, but after 1040626 fix #22907 pushed to master, this backward compatibility has been broken.The text was updated successfully, but these errors were encountered: