diff options
author | erdun <494251936@qq.com> | 2017-07-16 15:31:07 +0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-07-27 14:31:13 -0700 |
commit | 672e020f5f775140791979a943c16b29fb76c773 (patch) | |
tree | 21520de7ed1d1f444d9d2f5cd273718d6e050d23 /test/async-hooks/test-httpparser.response.js | |
parent | d731369b1d0822d5a766612a8a6ef3416aa9d580 (diff) | |
download | android-node-v8-672e020f5f775140791979a943c16b29fb76c773.tar.gz android-node-v8-672e020f5f775140791979a943c16b29fb76c773.tar.bz2 android-node-v8-672e020f5f775140791979a943c16b29fb76c773.zip |
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>
Diffstat (limited to 'test/async-hooks/test-httpparser.response.js')
-rw-r--r-- | test/async-hooks/test-httpparser.response.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/async-hooks/test-httpparser.response.js b/test/async-hooks/test-httpparser.response.js index d5ae8d65d8..5723ac6fbd 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' ); |