Skip to content

Commit

Permalink
Helper to tack on trailing / in notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed May 3, 2023
1 parent 76a8a29 commit 16f302d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"net/http"
"net/url"
"strings"

"github.com/jessepeterson/kmfddm/log"
)
Expand Down Expand Up @@ -57,6 +58,9 @@ func New(store EnrollmentIDFinder, urlBase, key string, opts ...Option) (*Notifi
multi: true,
}
var err error
if !strings.HasSuffix(urlBase, "/") {
urlBase += "/"
}
n.url, err = url.Parse(urlBase)
if err != nil {
return n, err
Expand Down

0 comments on commit 16f302d

Please sign in to comment.