|
@@ -98,6 +98,11 @@ func respondWithImage(ctx context.Context, reqID string, r *http.Request, rw htt
|
|
|
rw.Header().Set("Vary", headerVaryValue)
|
|
|
}
|
|
|
|
|
|
+ if conf.EnableDebugHeaders {
|
|
|
+ imgdata := getImageData(ctx)
|
|
|
+ rw.Header().Set("X-Origin-Content-Length", strconv.Itoa(len(imgdata.Data)))
|
|
|
+ }
|
|
|
+
|
|
|
if conf.GZipCompression > 0 && strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
|
|
|
buf := responseGzipBufPool.Get(0)
|
|
|
defer responseGzipBufPool.Put(buf)
|
|
@@ -119,11 +124,6 @@ func respondWithImage(ctx context.Context, reqID string, r *http.Request, rw htt
|
|
|
rw.Write(data)
|
|
|
}
|
|
|
|
|
|
- if conf.EnableDebugHeaders {
|
|
|
- imgdata := getImageData(ctx)
|
|
|
- rw.Header().Set("X-Origin-Content-Length", strconv.Itoa(len(imgdata.Data)))
|
|
|
- }
|
|
|
-
|
|
|
imageURL := getImageURL(ctx)
|
|
|
|
|
|
logResponse(reqID, r, 200, nil, &imageURL, po)
|