mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-20 12:23:26 +00:00
fix: address local UI guard and example executor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user