2
2
require ( '../common' ) ;
3
3
const assert = require ( 'assert' ) ;
4
4
const inspect = require ( 'util' ) . inspect ;
5
- const checkIsHttpToken = require ( '_http_common' ) . _checkIsHttpToken ;
6
- const checkInvalidHeaderChar = require ( '_http_common' ) . _checkInvalidHeaderChar ;
5
+ const { _checkIsHttpToken, _checkInvalidHeaderChar } = require ( '_http_common' ) ;
7
6
8
7
// Good header field names
9
8
[
@@ -29,8 +28,8 @@ const checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
29
28
'3.14159265359'
30
29
] . forEach ( function ( str ) {
31
30
assert . strictEqual (
32
- checkIsHttpToken ( str ) , true ,
33
- `checkIsHttpToken (${ inspect ( str ) } ) unexpectedly failed` ) ;
31
+ _checkIsHttpToken ( str ) , true ,
32
+ `_checkIsHttpToken (${ inspect ( str ) } ) unexpectedly failed` ) ;
34
33
} ) ;
35
34
// Bad header field names
36
35
[
@@ -55,8 +54,8 @@ const checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
55
54
'This,That'
56
55
] . forEach ( function ( str ) {
57
56
assert . strictEqual (
58
- checkIsHttpToken ( str ) , false ,
59
- `checkIsHttpToken (${ inspect ( str ) } ) unexpectedly succeeded` ) ;
57
+ _checkIsHttpToken ( str ) , false ,
58
+ `_checkIsHttpToken (${ inspect ( str ) } ) unexpectedly succeeded` ) ;
60
59
} ) ;
61
60
62
61
@@ -68,8 +67,8 @@ const checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
68
67
'!@#$%^&*()-_=+\\;\':"[]{}<>,./?|~`'
69
68
] . forEach ( function ( str ) {
70
69
assert . strictEqual (
71
- checkInvalidHeaderChar ( str ) , false ,
72
- `checkInvalidHeaderChar (${ inspect ( str ) } ) unexpectedly failed` ) ;
70
+ _checkInvalidHeaderChar ( str ) , false ,
71
+ `_checkInvalidHeaderChar (${ inspect ( str ) } ) unexpectedly failed` ) ;
73
72
} ) ;
74
73
75
74
// Bad header field values
@@ -84,6 +83,6 @@ const checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
84
83
'Ding!\x07'
85
84
] . forEach ( function ( str ) {
86
85
assert . strictEqual (
87
- checkInvalidHeaderChar ( str ) , true ,
88
- `checkInvalidHeaderChar (${ inspect ( str ) } ) unexpectedly succeeded` ) ;
86
+ _checkInvalidHeaderChar ( str ) , true ,
87
+ `_checkInvalidHeaderChar (${ inspect ( str ) } ) unexpectedly succeeded` ) ;
89
88
} ) ;
0 commit comments