fix: address local UI guard and example executor

This commit is contained in:
Finessse
2025-12-20 06:03:11 +07:00
parent 348609a93f
commit d44aadd1fc
3 changed files with 6 additions and 6 deletions
+1 -5
View File
@@ -629,7 +629,7 @@ func (s *Server) managementAvailabilityMiddleware() gin.HandlerFunc {
func (s *Server) serveManagementControlPanel(c *gin.Context) {
// Hidden fallback: only allow localhost and explicit opt-in.
if !isLocalClient(c.ClientIP()) {
if !isLocalClient(c) {
c.AbortWithStatus(http.StatusNotFound)
return
}
@@ -686,10 +686,6 @@ func (s *Server) serveManagementControlPanel(c *gin.Context) {
c.String(http.StatusOK, html)
}
func isLocalClient(ip string) bool {
return ip == "127.0.0.1" || ip == "::1"
}
func (s *Server) enableKeepAlive(timeout time.Duration, onTimeout func()) {
if timeout <= 0 || onTimeout == nil {
return