| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8c9b41a commit 9ae513a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,10 @@ | |||
| 3 | 3 | const common = require('../common.js'); | |
| 4 | 4 | const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar; | |
| 5 | 5 | ||
| 6 | + // Put it here so the benchmark result lines will not be super long. | ||
| 7 | + const LONG_AND_INVALID = 'Here is a value that is really a folded header ' + | ||
| 8 | + 'value\r\n this should be supported, but it is not currently'; | ||
| 9 | + | ||
| 6 | 10 | const bench = common.createBenchmark(main, { | |
| 7 | 11 | key: [ | |
| 8 | 12 | // Valid | |
@@ -21,8 +25,7 @@ const bench = common.createBenchmark(main, { | |||
| 21 | 25 | 'en-US', | |
| 22 | 26 | ||
| 23 | 27 | // Invalid | |
| 24 | - 'Here is a value that is really a folded header value\r\n this should be \ | ||
| 25 | - supported, but it is not currently', | ||
| 28 | + 'LONG_AND_INVALID', | ||
| 26 | 29 | '中文呢', // unicode | |
| 27 | 30 | 'foo\nbar', | |
| 28 | 31 | '\x7F' | |
@@ -31,6 +34,9 @@ const bench = common.createBenchmark(main, { | |||
| 31 | 34 | }); | |
| 32 | 35 | ||
| 33 | 36 | function main({ n, key }) { | |
| 37 | + if (key === 'LONG_AND_INVALID') { | ||
| 38 | + key = LONG_AND_INVALID; | ||
| 39 | + } | ||
| 34 | 40 | bench.start(); | |
| 35 | 41 | for (var i = 0; i < n; i++) { | |
| 36 | 42 | _checkInvalidHeaderChar(key); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments