mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-28 15:25:48 +08:00
Update internal/api/modules/amp/proxy.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -190,7 +190,8 @@ func createReverseProxy(upstreamURL string, secretSource SecretSource) (*httputi
|
|||||||
// Error handler for proxy failures
|
// Error handler for proxy failures
|
||||||
proxy.ErrorHandler = func(rw http.ResponseWriter, req *http.Request, err error) {
|
proxy.ErrorHandler = func(rw http.ResponseWriter, req *http.Request, err error) {
|
||||||
// Client-side cancellations are common during polling; suppress logging in this case
|
// Client-side cancellations are common during polling; suppress logging in this case
|
||||||
if err == context.Canceled {
|
if errors.Is(err, context.Canceled) {
|
||||||
|
rw.WriteHeader(gin.StatusClientClosedRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Errorf("amp upstream proxy error for %s %s: %v", req.Method, req.URL.Path, err)
|
log.Errorf("amp upstream proxy error for %s %s: %v", req.Method, req.URL.Path, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user