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

Bux fix for issue #8914 - Alertmanager error using custom function queryFromGeneratorURL #10358

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danieleandreatta
Copy link

Function queryFromGeneratorURL parses the generator URL with url.Parse() then calls url.QueryUnescape()

However url.Parse() already calls url.QueryUnescape():
https://github.com/golang/go/blob/7a2e88e9117e838f258b175fa535f671396d13da/src/net/url/url.go#L970

Query parameters containing characters % and + will be decoded incorrectly because of the double call to the unescape function.

What this PR does

Which issue(s) this PR fixes or relates to

Fixes #8914

Checklist

  • [x ] Tests updated.
  • [ x] Documentation added.
  • [x ] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • [x ] about-versioning.md updated with experimental features.

function queryFromGeneratorURL parses the generator URL with url.Parse()
then calls url.QueryUnescape()

However url.Parse() already calls url.QueryUnescape():

https://github.com/golang/go/blob/7a2e88e9117e838f258b175fa535f671396d13da/src/net/url/url.go#L970

Query parameters containing characters `%` and `+` will be decoded incorrectly.
@danieleandreatta danieleandreatta requested review from a team as code owners January 6, 2025 19:26
@CLAassistant
Copy link

CLAassistant commented Jan 6, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alertmanager error using custom function queryFromGeneratorURL
2 participants