优化反向代理相关错误提示

This commit is contained in:
刘祥超
2023-10-08 19:05:09 +08:00
parent 5733d466ca
commit 149e04d0e4

View File

@@ -335,7 +335,7 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId
shouldRetry = true shouldRetry = true
this.uri = oldURI // 恢复备份 this.uri = oldURI // 恢复备份
if httpErr.Err != io.EOF { if httpErr.Err != io.EOF && !errors.Is(httpErr.Err, http.ErrBodyReadAfterClose) {
remotelogs.WarnServer("HTTP_REQUEST_REVERSE_PROXY", this.URL()+": Request origin server failed: "+requestErr.Error()) remotelogs.WarnServer("HTTP_REQUEST_REVERSE_PROXY", this.URL()+": Request origin server failed: "+requestErr.Error())
} }
@@ -349,7 +349,7 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId
} else { } else {
this.write50x(requestErr, http.StatusBadGateway, "Failed to read origin site", "源站读取失败", true) this.write50x(requestErr, http.StatusBadGateway, "Failed to read origin site", "源站读取失败", true)
} }
if httpErr.Err != io.EOF { if httpErr.Err != io.EOF && !errors.Is(httpErr.Err, http.ErrBodyReadAfterClose) {
remotelogs.WarnServer("HTTP_REQUEST_REVERSE_PROXY", this.URL()+": Request origin server failed: "+requestErr.Error()) remotelogs.WarnServer("HTTP_REQUEST_REVERSE_PROXY", this.URL()+": Request origin server failed: "+requestErr.Error())
} }
} else { } else {