fix: return 404 on root path instead of redirecting to admin
Build and Push to GHCR / build-and-push (push) Has been cancelled
Build and Push to GHCR / build-and-push (push) Has been cancelled
via [HAPI](https://hapi.run) Co-Authored-By: HAPI <[email protected]>
This commit is contained in:
+1
-1
@@ -190,7 +190,7 @@ func buildHandler(cfg *config.Config) (*admin.Handler, http.Handler) {
|
|||||||
// 根路径处理
|
// 根路径处理
|
||||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
if r.URL.Path == "/" {
|
if r.URL.Path == "/" {
|
||||||
http.Redirect(w, r, adminPath+"/", http.StatusFound)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
authProxy.ServeHTTP(w, r)
|
authProxy.ServeHTTP(w, r)
|
||||||
|
|||||||
Reference in New Issue
Block a user