mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-19 22:09:03 +08:00
feat: Handle HTTP 444 Status Code (#7325)
This commit is contained in:
parent
a81cb5c1ab
commit
335a82332f
2 changed files with 4 additions and 5 deletions
|
|
@ -135,11 +135,6 @@ func CheckBind(req interface{}, c *gin.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ErrResponse(ctx *gin.Context, code int) {
|
|
||||||
ctx.JSON(code, nil)
|
|
||||||
ctx.Abort()
|
|
||||||
}
|
|
||||||
|
|
||||||
func ErrWithHtml(ctx *gin.Context, code int, scope string) {
|
func ErrWithHtml(ctx *gin.Context, code int, scope string) {
|
||||||
if code == 444 {
|
if code == 444 {
|
||||||
ctx.String(444, "")
|
ctx.String(444, "")
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ func LoadErrCode() int {
|
||||||
return http.StatusRequestTimeout
|
return http.StatusRequestTimeout
|
||||||
case "416":
|
case "416":
|
||||||
return http.StatusRequestedRangeNotSatisfiable
|
return http.StatusRequestedRangeNotSatisfiable
|
||||||
|
case "500":
|
||||||
|
return http.StatusInternalServerError
|
||||||
|
case "444":
|
||||||
|
return 444
|
||||||
default:
|
default:
|
||||||
return http.StatusOK
|
return http.StatusOK
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue