Skip to content

Commit 335a823

Browse files
feat: Handle HTTP 444 Status Code (#7325)
1 parent a81cb5c commit 335a823

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

backend/app/api/v1/helper/helper.go

-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ func CheckBind(req interface{}, c *gin.Context) error {
135135
return nil
136136
}
137137

138-
func ErrResponse(ctx *gin.Context, code int) {
139-
ctx.JSON(code, nil)
140-
ctx.Abort()
141-
}
142-
143138
func ErrWithHtml(ctx *gin.Context, code int, scope string) {
144139
if code == 444 {
145140
ctx.String(444, "")

backend/middleware/helper.go

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ func LoadErrCode() int {
2626
return http.StatusRequestTimeout
2727
case "416":
2828
return http.StatusRequestedRangeNotSatisfiable
29+
case "500":
30+
return http.StatusInternalServerError
31+
case "444":
32+
return 444
2933
default:
3034
return http.StatusOK
3135
}

0 commit comments

Comments
 (0)