Skip to content

Commit 262ece6

Browse files
committed
Merge pull request #1546 from enisoc/404
Redirect to /debug/status instead of 404 Not Found.
2 parents dc56878 + 88d1e5d commit 262ece6

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

go/cmd/vtgate/index.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2016, Google Inc. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"net/http"
9+
)
10+
11+
// This is a separate file so it can be selectively included/excluded from
12+
// builds to opt in/out of the redirect.
13+
14+
func init() {
15+
// Anything unrecognized gets redirected to the status page.
16+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
17+
http.Redirect(w, r, "/debug/status", http.StatusFound)
18+
})
19+
}

go/cmd/vttablet/index.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2016, Google Inc. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"net/http"
9+
)
10+
11+
// This is a separate file so it can be selectively included/excluded from
12+
// builds to opt in/out of the redirect.
13+
14+
func init() {
15+
// Anything unrecognized gets redirected to the status page.
16+
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
17+
http.Redirect(w, r, "/debug/status", http.StatusFound)
18+
})
19+
}

0 commit comments

Comments
 (0)