diff --git a/crproxy.go b/crproxy.go index cb29942..749662b 100644 --- a/crproxy.go +++ b/crproxy.go @@ -405,7 +405,7 @@ func (c *CRProxy) directResponse(rw http.ResponseWriter, r *http.Request, info * switch resp.StatusCode { case http.StatusUnauthorized, http.StatusForbidden: - c.logger.Warn("origin direct response 40x, but hit caches", "host", info.Host, "image", info.Image, "error", err, "response", dumpResponse(resp)) + c.logger.Warn("origin direct response 40x", "host", info.Host, "image", info.Image, "response", dumpResponse(resp)) errcode.ServeJSON(rw, errcode.ErrorCodeDenied) return } diff --git a/utils.go b/utils.go index 7e3622c..16749c9 100644 --- a/utils.go +++ b/utils.go @@ -162,6 +162,6 @@ func isDomainName(s string) bool { } func dumpResponse(resp *http.Response) string { - body, _ := io.ReadAll(io.LimitReader(resp.Body, 100)) + body, _ := io.ReadAll(io.LimitReader(resp.Body, 1024)) return fmt.Sprintf("%d %d %q", resp.StatusCode, resp.ContentLength, string(body)) }