fix: 静态文件路径 / 在 Auth 白名单中放行(供 Web UI 直接访问)
This commit is contained in:
parent
293ae82fb2
commit
0bda9a8420
|
|
@ -129,8 +129,9 @@ func Auth(next http.Handler) http.Handler {
|
|||
}
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// /health, /metrics, /static/* 不需要认证
|
||||
if r.URL.Path == "/health" || r.URL.Path == "/metrics" || strings.HasPrefix(r.URL.Path, "/static/") {
|
||||
// /health, /metrics, /static/*, / 不需要认证(/ 供 Web UI 使用)
|
||||
if r.URL.Path == "/health" || r.URL.Path == "/metrics" ||
|
||||
strings.HasPrefix(r.URL.Path, "/static/") || r.URL.Path == "/" {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue