mirror of https://github.com/lukechilds/node.git
Browse Source
PR-URL: https://github.com/nodejs/node/pull/10832 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>v6.x
abouthiroppy
8 years ago
committed by
Myles Borins
1 changed files with 33 additions and 0 deletions
@ -0,0 +1,33 @@ |
|||
'use strict'; |
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
const httpCommon = require('_http_common'); |
|||
const checkIsHttpToken = httpCommon._checkIsHttpToken; |
|||
const checkInvalidHeaderChar = httpCommon._checkInvalidHeaderChar; |
|||
|
|||
// checkIsHttpToken
|
|||
assert(checkIsHttpToken('t')); |
|||
assert(checkIsHttpToken('tt')); |
|||
assert(checkIsHttpToken('ttt')); |
|||
assert(checkIsHttpToken('tttt')); |
|||
assert(checkIsHttpToken('ttttt')); |
|||
|
|||
assert.strictEqual(checkIsHttpToken(''), false); |
|||
assert.strictEqual(checkIsHttpToken(' '), false); |
|||
assert.strictEqual(checkIsHttpToken('あ'), false); |
|||
assert.strictEqual(checkIsHttpToken('あa'), false); |
|||
assert.strictEqual(checkIsHttpToken('aaaaあaaaa'), false); |
|||
|
|||
// checkInvalidHeaderChar
|
|||
assert(checkInvalidHeaderChar('あ')); |
|||
assert(checkInvalidHeaderChar('aaaaあaaaa')); |
|||
|
|||
assert.strictEqual(checkInvalidHeaderChar(''), false); |
|||
assert.strictEqual(checkInvalidHeaderChar(1), false); |
|||
assert.strictEqual(checkInvalidHeaderChar(' '), false); |
|||
assert.strictEqual(checkInvalidHeaderChar(false), false); |
|||
assert.strictEqual(checkInvalidHeaderChar('t'), false); |
|||
assert.strictEqual(checkInvalidHeaderChar('tt'), false); |
|||
assert.strictEqual(checkInvalidHeaderChar('ttt'), false); |
|||
assert.strictEqual(checkInvalidHeaderChar('tttt'), false); |
|||
assert.strictEqual(checkInvalidHeaderChar('ttttt'), false); |
Loading…
Reference in new issue