| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b0ec8c9 commit 521b25a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -244,7 +244,7 @@ import { pipeline } from 'node:stream'; | |||
| 244 | 244 | const request = http.get({ host: 'example.com', | |
| 245 | 245 | path: '/', | |
| 246 | 246 | port: 80, | |
| 247 | - headers: { 'Accept-Encoding': 'br,gzip,deflate' } }); | ||
| 247 | + headers: { 'Accept-Encoding': 'br,gzip,deflate,zstd' } }); | ||
| 248 | 248 | request.on('response', (response) => { | |
| 249 | 249 | const output = fs.createWriteStream('example.com_index.html'); | |
| 250 | 250 | ||
@@ -266,6 +266,9 @@ request.on('response', (response) => { | |||
| 266 | 266 | case 'deflate': | |
| 267 | 267 | pipeline(response, zlib.createInflate(), output, onError); | |
| 268 | 268 | break; | |
| 269 | + case 'zstd': | ||
| 270 | + pipeline(response, zlib.createZstdDecompress(), output, onError); | ||
| 271 | + break; | ||
| 269 | 272 | default: | |
| 270 | 273 | pipeline(response, output, onError); | |
| 271 | 274 | break; | |
@@ -353,6 +356,9 @@ http.createServer((request, response) => { | |||
| 353 | 356 | } else if (/\bbr\b/.test(acceptEncoding)) { | |
| 354 | 357 | response.writeHead(200, { 'Content-Encoding': 'br' }); | |
| 355 | 358 | pipeline(raw, zlib.createBrotliCompress(), response, onError); | |
| 359 | + } else if (/\bzstd\b/.test(acceptEncoding)) { | ||
| 360 | + response.writeHead(200, { 'Content-Encoding': 'zstd' }); | ||
| 361 | + pipeline(raw, zlib.createZstdCompress(), response, onError); | ||
| 356 | 362 | } else { | |
| 357 | 363 | response.writeHead(200, {}); | |
| 358 | 364 | pipeline(raw, response, onError); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments