{"action":"created","issue":{"url":"https://api.github.com/repos/jaegertracing/jaeger-client-go/issues/271","repository_url":"https://api.github.com/repos/jaegertracing/jaeger-client-go","labels_url":"https://api.github.com/repos/jaegertracing/jaeger-client-go/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/jaegertracing/jaeger-client-go/issues/271/comments","events_url":"https://api.github.com/repos/jaegertracing/jaeger-client-go/issues/271/events","html_url":"https://github.com/jaegertracing/jaeger-client-go/issues/271","id":308655121,"number":271,"title":"trimming space in parseCommaSeparatedMap","user":{"login":"jsongHBO","id":3066783,"avatar_url":"https://avatars0.githubusercontent.com/u/3066783?v=4","gravatar_id":"","url":"https://api.github.com/users/jsongHBO","html_url":"https://github.com/jsongHBO","followers_url":"https://api.github.com/users/jsongHBO/followers","following_url":"https://api.github.com/users/jsongHBO/following{/other_user}","gists_url":"https://api.github.com/users/jsongHBO/gists{/gist_id}","starred_url":"https://api.github.com/users/jsongHBO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsongHBO/subscriptions","organizations_url":"https://api.github.com/users/jsongHBO/orgs","repos_url":"https://api.github.com/users/jsongHBO/repos","events_url":"https://api.github.com/users/jsongHBO/events{/privacy}","received_events_url":"https://api.github.com/users/jsongHBO/received_events","type":"User","site_admin":false},"labels":[{"id":360321195,"url":"https://api.github.com/repos/jaegertracing/jaeger-client-go/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-03-26T16:58:05Z","updated_at":"2018-03-26T17:26:10Z","closed_at":null,"author_association":"NONE","body":"The comments in https://github.com/jaegertracing/jaeger-client-go/blob/master/propagation.go#L267-L272\r\nsuggest that if I enter `\"key3  =  value3  \"`, then it should return `map[key3:value3]`\r\n\r\nBut it doesn't  \r\nhttps://goplay.space/#K-zW71Vr33C\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"log\"\r\n\t\"net/url\"\r\n\t\"strings\"\r\n)\r\n\r\nfunc parseCommaSeparatedMap(value string) map[string]string {\r\n\tbaggage := make(map[string]string)\r\n\tvalue, err := url.QueryUnescape(value)\r\n\tif err != nil {\r\n\t\tlog.Printf(\"Unable to unescape %s, %v\", value, err)\r\n\t\treturn baggage\r\n\t}\r\n\tfor _, kvpair := range strings.Split(value, \",\") {\r\n\t\tkv := strings.Split(strings.TrimSpace(kvpair), \"=\")\r\n\t\tif len(kv) == 2 {\r\n\t\t\tbaggage[kv[0]] = kv[1]\r\n\t\t} else {\r\n\t\t\tlog.Printf(\"Malformed value passed in for %s\", \"testHeader\")\r\n\t\t}\r\n\t}\r\n\treturn baggage\r\n}\r\n\r\nfunc main() {\r\n\tb := parseCommaSeparatedMap(\"key2=value2,    key3    =    value3   \")\r\n\tfmt.Printf(\"%+v\", b)\r\n\t// Returns map[key2:value2 key3    :    value3]\r\n}\r\n```\r\nsince trimming is not done after the `=` separation. \r\nI'm not sure if this is intentional or a bug.  If it's intentional, then the comments should be updated.  "},"comment":{"url":"https://api.github.com/repos/jaegertracing/jaeger-client-go/issues/comments/376245646","html_url":"https://github.com/jaegertracing/jaeger-client-go/issues/271#issuecomment-376245646","issue_url":"https://api.github.com/repos/jaegertracing/jaeger-client-go/issues/271","id":376245646,"user":{"login":"yurishkuro","id":3523016,"avatar_url":"https://avatars2.githubusercontent.com/u/3523016?v=4","gravatar_id":"","url":"https://api.github.com/users/yurishkuro","html_url":"https://github.com/yurishkuro","followers_url":"https://api.github.com/users/yurishkuro/followers","following_url":"https://api.github.com/users/yurishkuro/following{/other_user}","gists_url":"https://api.github.com/users/yurishkuro/gists{/gist_id}","starred_url":"https://api.github.com/users/yurishkuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurishkuro/subscriptions","organizations_url":"https://api.github.com/users/yurishkuro/orgs","repos_url":"https://api.github.com/users/yurishkuro/repos","events_url":"https://api.github.com/users/yurishkuro/events{/privacy}","received_events_url":"https://api.github.com/users/yurishkuro/received_events","type":"User","site_admin":false},"created_at":"2018-03-26T17:26:10Z","updated_at":"2018-03-26T17:26:10Z","author_association":"OWNER","body":"we have plans to switch baggage propagation format from `uberctx-{key}: value` to `jaeger-baggage: key=value`. When we do this, I would expect the following to hold\r\n```go\r\nspan.SetBaggage(\"key\", \" value\")\r\n// --- in another process\r\nspan.GetBaggage(\"key\") == \" value\" // leading space is preserved\r\n```\r\n\r\nIf we always trim the spaces the above will be broken. One could argue (correctly) that when encoding baggage in the client process it should use url encoding for the value, i.e. `key=%20value`, however that doesn't help with TEXT_MAP carriers that do not require any encoding."}}
{"actor":{"display_login":"yurishkuro"}}