From 335a82332fc678a97f299372f438cf0e4f6b19d7 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:57:43 +0800 Subject: [PATCH] feat: Handle HTTP 444 Status Code (#7325) --- backend/app/api/v1/helper/helper.go | 5 ----- backend/middleware/helper.go | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/app/api/v1/helper/helper.go b/backend/app/api/v1/helper/helper.go index 7e5566a29..330917ea5 100644 --- a/backend/app/api/v1/helper/helper.go +++ b/backend/app/api/v1/helper/helper.go @@ -135,11 +135,6 @@ func CheckBind(req interface{}, c *gin.Context) error { return nil } -func ErrResponse(ctx *gin.Context, code int) { - ctx.JSON(code, nil) - ctx.Abort() -} - func ErrWithHtml(ctx *gin.Context, code int, scope string) { if code == 444 { ctx.String(444, "") diff --git a/backend/middleware/helper.go b/backend/middleware/helper.go index eb422ece7..b1ead8c09 100644 --- a/backend/middleware/helper.go +++ b/backend/middleware/helper.go @@ -26,6 +26,10 @@ func LoadErrCode() int { return http.StatusRequestTimeout case "416": return http.StatusRequestedRangeNotSatisfiable + case "500": + return http.StatusInternalServerError + case "444": + return 444 default: return http.StatusOK }