Skip to content

Commit

Permalink
fix(net/ghttp): update response message handling in MiddlewareHandler…
Browse files Browse the repository at this point in the history
…Response
  • Loading branch information
hailaz committed Feb 20, 2025
1 parent 2fa0355 commit af3d2ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ghttp/ghttp_middleware_handler_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func MiddlewareHandlerResponse(r *Request) {
msg = err.Error()
} else {
if r.Response.Status > 0 && r.Response.Status != http.StatusOK {
msg = http.StatusText(r.Response.Status)
switch r.Response.Status {
case http.StatusNotFound:
code = gcode.CodeNotFound
Expand All @@ -77,6 +76,7 @@ func MiddlewareHandlerResponse(r *Request) {
} else {
code = gcode.CodeOK
}
msg = code.Message()
}

r.Response.WriteJson(DefaultHandlerResponse{
Expand Down

0 comments on commit af3d2ec

Please sign in to comment.