Skip to content

Commit

Permalink
Merge pull request #67 from GiedriusS/fix_root_handler
Browse files Browse the repository at this point in the history
main: return 404 in the root HTTP handler iff path is not "/"
  • Loading branch information
Matthias Rampke authored Dec 5, 2018
2 parents 4543d4c + f851151 commit 0daaf24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ func main() {
}()

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
http.NotFound(w, r)
return
}
w.Write([]byte(`<html>
<head><title>Graphite Exporter</title></head>
<body>
Expand Down

0 comments on commit 0daaf24

Please sign in to comment.