Add more logging
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2019-03-18 22:47:05 +01:00
parent 3c6a5ac4d0
commit df9bb9396c

View File

@ -176,7 +176,9 @@ func (handler *subscriptionHandler) handleSubscription(w http.ResponseWriter, r
if validateURL(validationURL.String(), ourChallenge) {
log.Printf("subscribe: validation valid\n")
err = handler.store.Subscribe(topicURL.String(), storage.Subscriber{callbackURL.String(), leaseSeconds, secret, time.Now()})
log.Printf("saving suscriber failed: %v", err)
if err != nil {
log.Printf("saving suscriber failed: %v", err)
}
} else {
log.Printf("subscribe: validation failed\n")
}
@ -186,6 +188,7 @@ func (handler *subscriptionHandler) handleSubscription(w http.ResponseWriter, r
}
func validateURL(url, challenge string) bool {
log.Println("validateURL: ", url)
client := http.Client{}
req, err := http.NewRequest(http.MethodGet, url, nil)