fix11: runtime contracts and smoke stability
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user