mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 13:00:52 +08:00
style(amp): standardize log message capitalization
This commit is contained in:
@@ -37,7 +37,7 @@ func localhostOnlyMiddleware() gin.HandlerFunc {
|
||||
// Parse the IP to handle both IPv4 and IPv6
|
||||
ip := net.ParseIP(host)
|
||||
if ip == nil {
|
||||
log.Warnf("Amp management: invalid RemoteAddr %s, denying access", remoteAddr)
|
||||
log.Warnf("amp management: invalid RemoteAddr %s, denying access", remoteAddr)
|
||||
c.AbortWithStatusJSON(403, gin.H{
|
||||
"error": "Access denied: management routes restricted to localhost",
|
||||
})
|
||||
@@ -46,7 +46,7 @@ func localhostOnlyMiddleware() gin.HandlerFunc {
|
||||
|
||||
// Check if IP is loopback (127.0.0.1 or ::1)
|
||||
if !ip.IsLoopback() {
|
||||
log.Warnf("Amp management: non-localhost connection from %s attempted access, denying", remoteAddr)
|
||||
log.Warnf("amp management: non-localhost connection from %s attempted access, denying", remoteAddr)
|
||||
c.AbortWithStatusJSON(403, gin.H{
|
||||
"error": "Access denied: management routes restricted to localhost",
|
||||
})
|
||||
@@ -89,9 +89,9 @@ func (m *AmpModule) registerManagementRoutes(engine *gin.Engine, baseHandler *ha
|
||||
// Apply localhost-only restriction if configured
|
||||
if restrictToLocalhost {
|
||||
ampAPI.Use(localhostOnlyMiddleware())
|
||||
log.Info("Amp management routes restricted to localhost only (CORS disabled)")
|
||||
log.Info("amp management routes restricted to localhost only (CORS disabled)")
|
||||
} else {
|
||||
log.Warn("⚠️ Amp management routes are NOT restricted to localhost - this is insecure!")
|
||||
log.Warn("amp management routes are NOT restricted to localhost - this is insecure!")
|
||||
}
|
||||
|
||||
// Management routes - these are proxied directly to Amp upstream
|
||||
|
||||
Reference in New Issue
Block a user