From 23cd934d719fe112f5e27605a4849c0d4e8dc8d8 Mon Sep 17 00:00:00 2001 From: erdun <494251936@qq.com> Date: Sun, 16 Jul 2017 15:31:07 +0800 Subject: [PATCH] test: refactor test-httpparser.response.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Reviewed-By: Gibson Fahnestock Reviewed-By: Benjamin Gruenbaum Reviewed-By: Tobias Nießen Reviewed-By: Refael Ackermann --- test/async-hooks/test-httpparser.response.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/async-hooks/test-httpparser.response.js b/test/async-hooks/test-httpparser.response.js index d5ae8d65d86df1..5723ac6fbdca53 100644 --- a/test/async-hooks/test-httpparser.response.js +++ b/test/async-hooks/test-httpparser.response.js @@ -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; @@ -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' );