Merge pull request #473 from martinlindhe/remove-redirect

BREAKING: Remove redirect from unknown paths to /metrics
This commit is contained in:
Calle Pettersson
2020-03-28 13:35:46 +01:00
committed by GitHub

View File

@@ -339,7 +339,13 @@ func main() {
http.HandleFunc(*metricsPath, withConcurrencyLimit(*maxRequests, h.ServeHTTP))
http.HandleFunc("/health", healthCheck)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, *metricsPath, http.StatusMovedPermanently)
_, _ = w.Write([]byte(`<html>
<head><title>WMI Exporter</title></head>
<body>
<h1>WMI Exporter</h1>
<p><a href="` + *metricsPath + `">Metrics</a></p>
</body>
</html>`))
})
log.Infoln("Starting WMI exporter", version.Info())