]> 127.0.0.1 Git - front/.git/commitdiff
1 v0.1.20250319022241
authorqydysky <qydysky@foxmail.com>
Wed, 19 Mar 2025 02:21:20 +0000 (02:21 +0000)
committerGitHub <noreply@github.com>
Wed, 19 Mar 2025 02:21:20 +0000 (02:21 +0000)
config.go

index f4192d701296790ee945be367770bce053508736..6f0e80b85e975cd15969293adee68663381812ce 100755 (executable)
--- a/config.go
+++ b/config.go
@@ -304,11 +304,13 @@ func (t *Config) SwapSign(ctx context.Context, logger Logger) {
                                        w.Header().Add(header+"Error", e.Error())
                                        if errors.Is(e, ErrHeaderCheckFail) || errors.Is(e, ErrBodyCheckFail) {
                                                w.WriteHeader(http.StatusForbidden)
-                                       } else if errors.Is(e, ErrAllBacksFail) {
-                                               w.WriteHeader(http.StatusBadGateway)
-                                               logger.Warn(`W:`, fmt.Sprintf(logFormat, reqId, r.RemoteAddr, route.config.Addr, routePath, "Err", ErrAllBacksFail))
                                        } else {
-                                               t.routeP.GetConn(r).Close()
+                                               if errors.Is(e, ErrAllBacksFail) {
+                                                       w.WriteHeader(http.StatusBadGateway)
+                                               } else {
+                                                       t.routeP.GetConn(r).Close()
+                                               }
+                                               logger.Warn(`W:`, fmt.Sprintf(logFormat, reqId, r.RemoteAddr, route.config.Addr, routePath, "Err", e))
                                        }
                                }
                        })