This commit is contained in:
parent
3c6a5ac4d0
commit
df9bb9396c
|
@ -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()})
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user