From c98752651a1275afc6574a0137c25821c585452d Mon Sep 17 00:00:00 2001 From: DarthSim Date: Tue, 18 Apr 2023 18:40:23 +0300 Subject: [PATCH] Don't set Content-DPR header --- CHANGELOG.md | 1 + docs/generating_the_url.md | 4 ---- processing_handler.go | 4 ---- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ec8a7f..6945e4ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ### Remove - Remove suport for `Viewport-Width` client hint. +- Don't set `Content-DPR` header (deprecated in the specification). ## [3.15.0] - 2023-04-10 ### Add diff --git a/docs/generating_the_url.md b/docs/generating_the_url.md index 398182cb..8cb4752c 100644 --- a/docs/generating_the_url.md +++ b/docs/generating_the_url.md @@ -137,8 +137,6 @@ Can be combined with `width` and `height` options. In this case, imgproxy calcul **📝 Note:** Unlike the `dpr` option, the `zoom` option doesn't affect gravities offsets, watermark offsets, and paddings. -**📝 Note:** Unlike [dpr](#dpr), `zoom` doesn't set the `Content-DPR` header in the response. - Default: `1` ### Dpr @@ -151,8 +149,6 @@ When set, imgproxy will multiply the image dimensions according to this factor f **📝 Note:** The `dpr` option affects gravities offsets, watermark offsets, and paddings to make the resulting image structures with and without the `dpr` option applied match. -**📝 Note:** `dpr` also sets the `Content-DPR` header in the response so the browser can correctly render the image. - Default: `1` ### Enlarge diff --git a/processing_handler.go b/processing_handler.go index f95bc32c..4dec9c04 100644 --- a/processing_handler.go +++ b/processing_handler.go @@ -117,10 +117,6 @@ func respondWithImage(reqID string, r *http.Request, rw http.ResponseWriter, sta rw.Header().Set("Content-Type", resultData.Type.Mime()) rw.Header().Set("Content-Disposition", contentDisposition) - if po.Dpr != 1 { - rw.Header().Set("Content-DPR", strconv.FormatFloat(po.Dpr, 'f', 2, 32)) - } - setCacheControl(rw, po.Expires, originData.Headers) setVary(rw) setCanonical(rw, originURL)