fix11: runtime contracts and smoke stability

This commit is contained in:
2026-04-30 21:50:03 +05:00
parent 4a0d9569d1
commit a41f14067b
10 changed files with 105 additions and 88 deletions
+6 -3
View File
@@ -5,7 +5,6 @@ import (
"net/http"
"github.com/gin-gonic/gin"
"hy2xs-admin/model/vo"
)
func LocalOnlyHandler() gin.HandlerFunc {
@@ -16,8 +15,12 @@ func LocalOnlyHandler() gin.HandlerFunc {
}
if host != "127.0.0.1" && host != "::1" {
vo.Fail("local access only", c)
c.AbortWithStatus(http.StatusForbidden)
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{
"code": http.StatusForbidden,
"type": "no",
"message": "local access only",
"data": nil,
})
return
}