Skip to content

Commit

Permalink
fix: handle web API passthrough bad request
Browse files Browse the repository at this point in the history
  • Loading branch information
devgianlu committed Sep 17, 2024
1 parent f99be98 commit 57fc714
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/daemon/api_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ func (s *ApiServer) handleRequest(req ApiRequest, w http.ResponseWriter) {
case errors.Is(resp.err, ErrTooManyRequests):
w.WriteHeader(http.StatusTooManyRequests)
return
case errors.Is(resp.err, ErrBadRequest):
w.WriteHeader(http.StatusBadRequest)
return
default:
log.WithError(resp.err).Errorf("failed handling request %s", req.Type)
w.WriteHeader(http.StatusInternalServerError)
Expand Down

0 comments on commit 57fc714

Please sign in to comment.