Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: use test() in boolean context in zlib.md
  • Loading branch information
vsemozhetbyt committed May 31, 2017
commit 8a3756c5b37fc77d4a7ac237d0d1f5ac9cc9095a
4 changes: 2 additions & 2 deletions doc/api/zlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ http.createServer((request, response) => {

// Note: This is not a conformant accept-encoding parser.
// See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
if (acceptEncoding.match(/\bdeflate\b/)) {
if (/\bdeflate\b/.test(acceptEncoding)) {
response.writeHead(200, { 'Content-Encoding': 'deflate' });
raw.pipe(zlib.createDeflate()).pipe(response);
} else if (acceptEncoding.match(/\bgzip\b/)) {
} else if (/\bgzip\b/.test(acceptEncoding)) {
response.writeHead(200, { 'Content-Encoding': 'gzip' });
raw.pipe(zlib.createGzip()).pipe(response);
} else {
Expand Down