test: refactor test-httpparser.response.js
* replace CRLF constant with '\r\n' literal * fix typo in HTTP header name PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
d731369b1d
commit
672e020f5f
@ -9,7 +9,6 @@ const { checkInvocations } = require('./hook-checks');
|
|||||||
const binding = process.binding('http_parser');
|
const binding = process.binding('http_parser');
|
||||||
const HTTPParser = binding.HTTPParser;
|
const HTTPParser = binding.HTTPParser;
|
||||||
|
|
||||||
const CRLF = '\r\n';
|
|
||||||
const RESPONSE = HTTPParser.RESPONSE;
|
const RESPONSE = HTTPParser.RESPONSE;
|
||||||
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
|
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
|
||||||
const kOnBody = HTTPParser.kOnBody | 0;
|
const kOnBody = HTTPParser.kOnBody | 0;
|
||||||
@ -19,10 +18,10 @@ const hooks = initHooks();
|
|||||||
hooks.enable();
|
hooks.enable();
|
||||||
|
|
||||||
const request = Buffer.from(
|
const request = Buffer.from(
|
||||||
'HTTP/1.1 200 OK' + CRLF +
|
'HTTP/1.1 200 OK\r\n' +
|
||||||
'Content-types: text/plain' + CRLF +
|
'Content-Type: text/plain\r\n' +
|
||||||
'Content-Length: 4' + CRLF +
|
'Content-Length: 4\r\n' +
|
||||||
CRLF +
|
'\r\n' +
|
||||||
'pong'
|
'pong'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user