Merge pull request #612 from prometheus/strip-am-url-slash

Strip trailing slash in alertmanager URL.
This commit is contained in:
Julius Volz 2015-03-30 20:18:03 +02:00
commit b456240c46
1 changed files with 2 additions and 1 deletions

View File

@ -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),