Don't crash on nil proxy in StatusHTTP
This commit is contained in:
1 parent
81d79a64e6
commit
e0bb49aa23
1 file changed
+3
-1
+3
-1
@@ -442,7 +442,9 @@ func main() {
|
|||||||
HandleHTTP(muxRouter, version, router, allocator, defaultSubnet, ns, dnsserver, &waitReady)
|
HandleHTTP(muxRouter, version, router, allocator, defaultSubnet, ns, dnsserver, &waitReady)
|
||||||
HandleHTTPPeer(muxRouter, allocator, discoveryEndpoint, token, name.String())
|
HandleHTTPPeer(muxRouter, allocator, discoveryEndpoint, token, name.String())
|
||||||
muxRouter.Methods("GET").Path("/metrics").Handler(metricsHandler(router, allocator, ns, dnsserver))
|
muxRouter.Methods("GET").Path("/metrics").Handler(metricsHandler(router, allocator, ns, dnsserver))
|
||||||
muxRouter.Methods("GET").Path("/proxyaddrs").HandlerFunc(proxy.StatusHTTP)
|
if proxy != nil {
|
||||||
|
muxRouter.Methods("GET").Path("/proxyaddrs").HandlerFunc(proxy.StatusHTTP)
|
||||||
|
}
|
||||||
http.Handle("/", common.LoggingHTTPHandler(muxRouter))
|
http.Handle("/", common.LoggingHTTPHandler(muxRouter))
|
||||||
Log.Println("Listening for HTTP control messages on", httpAddr)
|
Log.Println("Listening for HTTP control messages on", httpAddr)
|
||||||
go listenAndServeHTTP(httpAddr, nil)
|
go listenAndServeHTTP(httpAddr, nil)
|
||||||
|
|||||||
Reference in new issue
Block a user