parent
aa257744f0
commit
68d84bdaa3
|
@ -66,12 +66,12 @@ func (handler *subscriptionHandler) handlePublish(w http.ResponseWriter, r *http
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
handler.incStat(fmt.Sprintf("publish.%s", topic))
|
// handler.incStat(fmt.Sprintf("publish.%s", topic))
|
||||||
|
|
||||||
if subs, e := handler.Subscribers[topic]; e {
|
if subs, e := handler.Subscribers[topic]; e {
|
||||||
for _, sub := range subs {
|
for _, sub := range subs {
|
||||||
|
|
||||||
handler.incStat(fmt.Sprintf("publish.post.%s.%s", topic, sub.Callback))
|
// handler.incStat(fmt.Sprintf("publish.post.%s.%s", topic, sub.Callback))
|
||||||
log.Printf("publish: creating post to %s\n", sub.Callback)
|
log.Printf("publish: creating post to %s\n", sub.Callback)
|
||||||
postReq, err := http.NewRequest("POST", sub.Callback, strings.NewReader(string(feedContent)))
|
postReq, err := http.NewRequest("POST", sub.Callback, strings.NewReader(string(feedContent)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -264,7 +264,7 @@ func (handler *subscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
||||||
if r.Method == http.MethodGet {
|
if r.Method == http.MethodGet {
|
||||||
fmt.Fprintln(w, "WebSub hub")
|
fmt.Fprintln(w, "WebSub hub")
|
||||||
if r.URL.Query().Get("debug") == "1" {
|
if r.URL.Query().Get("debug") == "1" {
|
||||||
handler.incStat("http.index.debug")
|
// handler.incStat("http.index.debug")
|
||||||
enc := json.NewEncoder(w)
|
enc := json.NewEncoder(w)
|
||||||
enc.SetIndent("", " ")
|
enc.SetIndent("", " ")
|
||||||
enc.Encode(handler.Subscribers)
|
enc.Encode(handler.Subscribers)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user