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: error in parsing query params #47070

Closed
iag92 opened this issue Jul 6, 2021 · 1 comment
Closed

net/url: error in parsing query params #47070

iag92 opened this issue Jul 6, 2021 · 1 comment

Comments

@iag92
Copy link

iag92 commented Jul 6, 2021

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

go version go1.16.5 linux/amd64 

What did you do?

https://play.golang.org/p/tafjqQPspos

package main

import (
  "fmt"
  "net/url"
)

func main() {
  params := "?ver=ImageDescription:%200.2.18-r19-pub-250;%20ImageDate:%20Mon%20Jun%2012%2011:04:49%20EEST%202017;%20PORTAL%20version:%204.9.15;%20API%20Version:%20JS%20API%20version:%20328;%20STB%20API%20version:%20134;%20Player%20Engine%20version:%200x566"
  u, err := url.Parse("http://localhost/test"+params)
  if err != nil {
    fmt.Println("ERROR",err) 
  }
  fmt.Println(u.Query())
}

What did you expect to see?

map[ ver:[ImageDescription: 0.2.18-r19-pub-250; ImageDate: Mon Jun 12 11:04:49 EEST 2017; PORTAL version: 4.9.15; API Version: JS API version: 328; STB API version: 134; Player Engine version: 0x566]]

What did you see instead?

map[ API Version: JS API version: 328:[]  ImageDate: Mon Jun 12 11:04:49 EEST 2017:[]  PORTAL version: 4.9.15:[]  Player Engine version: 0x566:[]  STB API version: 134:[] ver:[ImageDescription: 0.2.18-r19-pub-250]]

Description:

Request from IPTV Box. For test: in URL exist only one param 'ver'. Browsers, PHP language and others parse params correctly. For example correct parsing in Google Chrome 'Developer tools' on screenshot

golang-bug

@seankhliao
Copy link
Member

Duplicate of #25192

@seankhliao seankhliao marked this as a duplicate of #25192 Jul 6, 2021
@golang golang locked and limited conversation to collaborators Jul 6, 2022
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