From 40a5a93b411e10d480a5de4e154580200a44961f Mon Sep 17 00:00:00 2001 From: Mukul Khanna Date: Tue, 26 Feb 2019 06:25:45 +0530 Subject: [PATCH] doc: add example for setting Vary: Accept-Encoding header in zlib.md PR-URL: https://github.com/nodejs/node/pull/26308 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- doc/api/zlib.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/zlib.md b/doc/api/zlib.md index f4bcaf95a204e7..6efc2a709c339d 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -107,6 +107,8 @@ const http = require('http'); const fs = require('fs'); http.createServer((request, response) => { const raw = fs.createReadStream('index.html'); + // Store both a compressed and an uncompressed version of the resource. + response.setHeader('Vary: Accept-Encoding'); let acceptEncoding = request.headers['accept-encoding']; if (!acceptEncoding) { acceptEncoding = '';