mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
fix(auth): address index logic bug and remove redundant conditions
- Updated loop iteration in `AuthSelector` to correct index management for selecting candidates. - Fixed cursor index reset condition for large values to prevent overflow. - Removed unnecessary conditional reassignment of `allowRemote` in management handler for clarity and correctness.
This commit is contained in:
@@ -73,9 +73,6 @@ func (h *Handler) Middleware() gin.HandlerFunc {
|
||||
h.attemptsMu.Unlock()
|
||||
|
||||
allowRemote := h.cfg.RemoteManagement.AllowRemote
|
||||
if !allowRemote {
|
||||
allowRemote = true
|
||||
}
|
||||
if !allowRemote {
|
||||
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"error": "remote management disabled"})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user