summaryrefslogtreecommitdiff
path: root/doc/api/zlib.md
diff options
context:
space:
mode:
authorMukul Khanna <mukul18khanna@gmail.com>2019-02-26 06:25:45 +0530
committerRich Trott <rtrott@gmail.com>2019-02-28 12:41:11 -0800
commit86f13d674adafb489f32d9d52925991e1b2d7cb0 (patch)
tree1bf7b8a32cbcd520d89409d261a221d52f33089c /doc/api/zlib.md
parenta32cbe159749c645bf2da6b2af46f9b732b416e0 (diff)
downloadandroid-node-v8-86f13d674adafb489f32d9d52925991e1b2d7cb0.tar.gz
android-node-v8-86f13d674adafb489f32d9d52925991e1b2d7cb0.tar.bz2
android-node-v8-86f13d674adafb489f32d9d52925991e1b2d7cb0.zip
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 <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/api/zlib.md')
-rw-r--r--doc/api/zlib.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/api/zlib.md b/doc/api/zlib.md
index f4bcaf95a2..6efc2a709c 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 = '';