From 5aae27302669bd4cf95b0f01f67d2a870f107ea5 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Mon, 23 Mar 2015 19:17:42 +0100 Subject: [PATCH] Strip trailing slash in alertmanager URL. Fixes https://github.com/prometheus/prometheus/issues/607 --- notification/notification.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notification/notification.go b/notification/notification.go index 7039195c0..c95cc0ceb 100644 --- a/notification/notification.go +++ b/notification/notification.go @@ -20,6 +20,7 @@ import ( "io" "io/ioutil" "net/http" + "strings" "time" "github.com/golang/glog" @@ -95,7 +96,7 @@ type NotificationHandler struct { // NewNotificationHandler constructs a new NotificationHandler. func NewNotificationHandler(alertmanagerURL string, notificationQueueCapacity int) *NotificationHandler { return &NotificationHandler{ - alertmanagerURL: alertmanagerURL, + alertmanagerURL: strings.TrimRight(alertmanagerURL, "/"), pendingNotifications: make(chan NotificationReqs, notificationQueueCapacity), httpClient: utility.NewDeadlineClient(*deadline),