Skip to content

Commit

Permalink
fix: StatusRequestTimeout→StatusGatewayTimeout
Browse files Browse the repository at this point in the history
I believe the context timeouts gateway code will hit are not related to client not sending data, so 408 was invalid here.
  • Loading branch information
lidel authored Feb 24, 2023
1 parent 88f007f commit c08d8f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gateway/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func webError(w http.ResponseWriter, err error, defaultCode int) {
} else if errors.Is(err, ErrBadGateway) {
webErrorWithCode(w, err, http.StatusBadGateway)
} else if errors.Is(err, context.DeadlineExceeded) || err == context.DeadlineExceeded {
webErrorWithCode(w, err, http.StatusRequestTimeout)
webErrorWithCode(w, err, http.StatusGatewayTimeout)
} else {
webErrorWithCode(w, err, defaultCode)
}
Expand Down

0 comments on commit c08d8f7

Please sign in to comment.