test: simplify test-http-client-unescaped-path
PR-URL: https://github.com/nodejs/node/pull/9649 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
8f05611a5c
commit
dbf4bf2bec
@ -3,12 +3,8 @@ const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const http = require('http');
|
||||
|
||||
function* bad() {
|
||||
for (let i = 0; i <= 32; i += 1)
|
||||
yield 'bad' + String.fromCharCode(i) + 'path';
|
||||
}
|
||||
|
||||
for (const path of bad()) {
|
||||
for (let i = 0; i <= 32; i += 1) {
|
||||
const path = 'bad' + String.fromCharCode(i) + 'path';
|
||||
assert.throws(() => http.get({ path }, common.fail),
|
||||
/contains unescaped characters/);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user