Skip to content

Commit 94e070b

Browse files
committed
clusterinfo: url.QueryEscape url parameters
1 parent 25bc210 commit 94e070b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/clusterinfo/data.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ func (c *ClusterInfo) GetNSQDTopicProducers(topic string, nsqdHTTPAddrs []string
450450
go func(addr string) {
451451
defer wg.Done()
452452

453-
endpoint := fmt.Sprintf("http://%s/stats?format=json&topic=%s", addr, topic)
453+
endpoint := fmt.Sprintf("http://%s/stats?format=json&topic=%s", addr, url.QueryEscape(topic))
454454
c.logf("CI: querying nsqd %s", endpoint)
455455

456456
var statsResp statsRespType
@@ -552,9 +552,9 @@ func (c *ClusterInfo) GetNSQDStats(producers Producers, selectedTopic string, se
552552

553553
endpoint := fmt.Sprintf("http://%s/stats?format=json", addr)
554554
if selectedTopic != "" {
555-
endpoint += "&topic=" + selectedTopic
555+
endpoint += "&topic=" + url.QueryEscape(selectedTopic)
556556
if selectedChannel != "" {
557-
endpoint += "&channel=" + selectedChannel
557+
endpoint += "&channel=" + url.QueryEscape(selectedChannel)
558558
}
559559
}
560560

0 commit comments

Comments
 (0)