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

cmd/alertmanager: reject invalid external URLs #1960

Merged

Conversation

simonpasquier
Copy link
Member

Closes #1912

Using --web.external-url=foo:123 instead of --web.external-url=http://foo:123 was accepted before but it's (almost) never what you want as html/template will escape the value to #ZgotmplZ because it only accepts http://..., https://... or mailto://... links.

Copy link
Contributor

@brian-brazil brian-brazil left a comment

Choose a reason for hiding this comment

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

I think you may have forgotten to push some changes.

cmd/alertmanager/main.go Outdated Show resolved Hide resolved
api/api.go Outdated Show resolved Hide resolved
cmd/alertmanager/main.go Outdated Show resolved Hide resolved
@brian-brazil
Copy link
Contributor

👍

cmd/alertmanager/main.go Outdated Show resolved Hide resolved
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@simonpasquier simonpasquier merged commit 78c9ebc into prometheus:master Jul 22, 2019
@simonpasquier simonpasquier deleted the reject-invalid-external-url branch July 22, 2019 12:35
DuskEagle pushed a commit to DuskEagle/alertmanager that referenced this pull request Aug 1, 2019
* cmd/alertmanager: reject invalid external URLs

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Address Brian's comments

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Simplify the code according to Max's feedback

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
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.

Template email not replacing external and generator URL
3 participants