Skip to content

Commit

Permalink
test: refactor test-httpparser.response.js
Browse files Browse the repository at this point in the history
* replace CRLF constant with '\r\n' literal
* fix typo in HTTP header name

PR-URL: nodejs#14290
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
erdun authored and addaleax committed Jul 27, 2017
1 parent d11840c commit 23cd934
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/async-hooks/test-httpparser.response.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const { checkInvocations } = require('./hook-checks');
const binding = process.binding('http_parser');
const HTTPParser = binding.HTTPParser;

const CRLF = '\r\n';
const RESPONSE = HTTPParser.RESPONSE;
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
const kOnBody = HTTPParser.kOnBody | 0;
Expand All @@ -19,10 +18,10 @@ const hooks = initHooks();
hooks.enable();

const request = Buffer.from(
'HTTP/1.1 200 OK' + CRLF +
'Content-types: text/plain' + CRLF +
'Content-Length: 4' + CRLF +
CRLF +
'HTTP/1.1 200 OK\r\n' +
'Content-Type: text/plain\r\n' +
'Content-Length: 4\r\n' +
'\r\n' +
'pong'
);

Expand Down

0 comments on commit 23cd934

Please sign in to comment.