Skip to content

Commit

Permalink
feat: Handle HTTP 444 Status Code (#7325)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored Dec 11, 2024
1 parent a81cb5c commit 335a823
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 0 additions & 5 deletions backend/app/api/v1/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "")
Expand Down
4 changes: 4 additions & 0 deletions backend/middleware/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 335a823

Please sign in to comment.