This commit is contained in:
parent
d75e55ec49
commit
d58d21d491
|
@ -175,7 +175,8 @@ func (handler *subscriptionHandler) handleSubscription(w http.ResponseWriter, r
|
|||
|
||||
if validateURL(validationURL.String(), ourChallenge) {
|
||||
log.Printf("subscribe: validation valid\n")
|
||||
_ = handler.store.Subscribe(topicURL.String(), storage.Subscriber{callbackURL.String(), leaseSeconds, secret, time.Now()})
|
||||
err = handler.store.Subscribe(topicURL.String(), storage.Subscriber{callbackURL.String(), leaseSeconds, secret, time.Now()})
|
||||
log.Println("saving suscriber failed: %v", err)
|
||||
} else {
|
||||
log.Printf("subscribe: validation failed\n")
|
||||
}
|
||||
|
@ -224,13 +225,16 @@ func (handler *subscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
|||
|
||||
if mode == "subscribe" {
|
||||
err = handler.handleSubscription(w, r)
|
||||
log.Println("saving subscribe failed: %v", err)
|
||||
return
|
||||
} else if mode == "unsubscribe" {
|
||||
err = handler.handleUnsubscription(w, r)
|
||||
log.Println("saving unsubscribe failed: %v", err)
|
||||
return
|
||||
} else if mode == "publish" {
|
||||
log.Println("hub.mode=publish received")
|
||||
err = handler.handlePublish(w, r)
|
||||
log.Println("handling publish failed: %v", err)
|
||||
return
|
||||
} else {
|
||||
http.Error(w, "Unknown hub.mode", 400)
|
||||
|
|
Loading…
Reference in New Issue
Block a user