notify.go (nsq-1.2.0) | : | notify.go (nsq-1.2.1) | ||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
return "" | return "" | |||
} | } | |||
pair := strings.SplitN(string(b), ":", 2) | pair := strings.SplitN(string(b), ":", 2) | |||
if len(pair) != 2 { | if len(pair) != 2 { | |||
return "" | return "" | |||
} | } | |||
return pair[0] | return pair[0] | |||
} | } | |||
func (s *httpServer) notifyAdminAction(action, topic, channel, node string, req *http.Request) { | func (s *httpServer) notifyAdminAction(action, topic, channel, node string, req *http.Request) { | |||
if s.ctx.nsqadmin.getOpts().NotificationHTTPEndpoint == "" { | if s.nsqadmin.getOpts().NotificationHTTPEndpoint == "" { | |||
return | return | |||
} | } | |||
via, _ := os.Hostname() | via, _ := os.Hostname() | |||
u := url.URL{ | u := url.URL{ | |||
Scheme: "http", | Scheme: "http", | |||
Host: req.Host, | Host: req.Host, | |||
Path: req.URL.Path, | Path: req.URL.Path, | |||
RawQuery: req.URL.RawQuery, | RawQuery: req.URL.RawQuery, | |||
} | } | |||
skipping to change at line 70 | skipping to change at line 70 | |||
Channel: channel, | Channel: channel, | |||
Node: node, | Node: node, | |||
Timestamp: time.Now().Unix(), | Timestamp: time.Now().Unix(), | |||
User: basicAuthUser(req), | User: basicAuthUser(req), | |||
RemoteIP: req.RemoteAddr, | RemoteIP: req.RemoteAddr, | |||
UserAgent: req.UserAgent(), | UserAgent: req.UserAgent(), | |||
URL: u.String(), | URL: u.String(), | |||
Via: via, | Via: via, | |||
} | } | |||
// Perform all work in a new goroutine so this never blocks | // Perform all work in a new goroutine so this never blocks | |||
go func() { s.ctx.nsqadmin.notifications <- a }() | go func() { s.nsqadmin.notifications <- a }() | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |