fix http response code when forwarder node is not available

This commit is contained in:
ginuerzh
2023-01-31 18:07:44 +08:00
parent ebdb77d71f
commit 9750998940
5 changed files with 8 additions and 3 deletions

View File

@ -181,6 +181,7 @@ func (h *forwardHandler) handleHTTP(ctx context.Context, rw io.ReadWriter, log l
}
if target == nil {
log.Warnf("node for %s not found", req.Host)
resp.StatusCode = http.StatusBadGateway
return resp.Write(rw)
}