浏览代码

Don't set Content-DPR header

DarthSim 2 年之前
父节点
当前提交
c98752651a
共有 3 个文件被更改,包括 1 次插入8 次删除
  1. 1 0
      CHANGELOG.md
  2. 0 4
      docs/generating_the_url.md
  3. 0 4
      processing_handler.go

+ 1 - 0
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

+ 0 - 4
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

+ 0 - 4
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)