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

logcli: Query needs to be stored into url.RawQuery, and not url.Path #2027

Merged
merged 3 commits into from
May 1, 2020
Merged

logcli: Query needs to be stored into url.RawQuery, and not url.Path #2027

merged 3 commits into from
May 1, 2020

Conversation

pstibrany
Copy link
Member

@pstibrany pstibrany commented May 1, 2020

Logcli put path + query string into url.Path field, which was then path-encoded into:

https://logs-dev-ops-tools1.grafana.net/loki/api/v1/query_range%3Fdirection=BACKWARD&end=1588318369339918000&limit=30&query=%257Bnamespace%253D%2522loki-ops2%2522%257D&start=1588314769339918000

which doesn't work.

Query needs to be stored into RawQuery field instead to be correctly encoded as a query string after ?.

This PR also removes now unused EncodeWithPath method from QueryStringBuilder.

Related to #2000, which introduced buildURL function.

Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cyriltovena cyriltovena merged commit 4906fb2 into grafana:master May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants