mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
534 B
21 lines
534 B
8 years ago
|
'use strict';
|
||
|
const common = require('../common');
|
||
|
const assert = require('assert');
|
||
|
const http = require('http');
|
||
|
|
||
|
const expectedError = /^TypeError: Request path contains unescaped characters$/;
|
||
|
const theExperimentallyDeterminedNumber = 39;
|
||
|
|
||
|
function fail(path) {
|
||
|
assert.throws(() => {
|
||
|
http.request({ path }, common.fail);
|
||
|
}, expectedError);
|
||
|
}
|
||
|
|
||
|
for (let i = 0; i <= theExperimentallyDeterminedNumber; i++) {
|
||
|
const prefix = 'a'.repeat(i);
|
||
|
for (let i = 0; i <= 32; i++) {
|
||
|
fail(prefix + String.fromCodePoint(i));
|
||
|
}
|
||
|
}
|