diff options
author | Aleksei <37804671+aleert@users.noreply.github.com> | 2020-10-01 23:02:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 14:02:31 -0600 |
commit | 3b9eae70c9cc680792cdc86513f74f7cc49f43b1 (patch) | |
tree | 3cf5728f0e5fb918e70f541d015ecab8430abd35 | |
parent | aa9c3eb7324461c0dd4f1dd28e767d0b8d0d7ec3 (diff) |
reverseproxy: Change 500 error to 502 for lookup_srv config (#3771)
Fixes #3763
-rw-r--r-- | modules/caddyhttp/reverseproxy/reverseproxy.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/caddyhttp/reverseproxy/reverseproxy.go b/modules/caddyhttp/reverseproxy/reverseproxy.go index 138a3fc..0f93df0 100644 --- a/modules/caddyhttp/reverseproxy/reverseproxy.go +++ b/modules/caddyhttp/reverseproxy/reverseproxy.go @@ -384,7 +384,8 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyht // DialInfo struct should have valid network address syntax dialInfo, err := upstream.fillDialInfo(r) if err != nil { - return fmt.Errorf("making dial info: %v", err) + err = fmt.Errorf("making dial info: %v", err) + return caddyhttp.Error(http.StatusBadGateway, err) } // attach to the request information about how to dial the upstream; |