mirror of
				https://github.com/imgproxy/imgproxy.git
				synced 2025-10-30 23:08:02 +02:00 
			
		
		
		
	Fix debug header
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user