Skip to content

Commit

Permalink
Merge pull request #473 from martinlindhe/remove-redirect
Browse files Browse the repository at this point in the history
BREAKING: Remove redirect from unknown paths to /metrics
  • Loading branch information
carlpett authored Mar 28, 2020
2 parents cba42d2 + df954dd commit 1d7747b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 1d7747b

Please sign in to comment.