notifier: Verify that the given webhook endpoint is an absolute URL

This commit is contained in:
Quentin Machu 2016-04-12 13:52:15 -04:00
parent 2fb815dc37
commit 927af43be0

View File

@ -78,7 +78,7 @@ func (h *WebhookNotifier) Configure(config *config.NotifierConfig) (bool, error)
if httpConfig.Endpoint == "" {
return false, nil
}
if _, err := url.Parse(httpConfig.Endpoint); err != nil {
if _, err := url.ParseRequestURI(httpConfig.Endpoint); err != nil {
return false, fmt.Errorf("could not parse endpoint URL: %s\n", err)
}
h.endpoint = httpConfig.Endpoint