mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-07 02:37:28 +08:00
secure webui: require token auth on /webui page
This commit is contained in:
@@ -120,6 +120,10 @@ func (s *RegistryServer) handleWebUI(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if !s.checkAuth(r) {
|
||||||
|
http.Error(w, "unauthorized", http.StatusUnauthorized)
|
||||||
|
return
|
||||||
|
}
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
_, _ = w.Write([]byte(webUIHTML))
|
_, _ = w.Write([]byte(webUIHTML))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user