Skip to content

Commit dbf4bf2

Browse files
rvaggaddaleax
authored andcommitted
test: simplify test-http-client-unescaped-path
PR-URL: #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>
1 parent 8f05611 commit dbf4bf2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

test/parallel/test-http-client-unescaped-path.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ const common = require('../common');
33
const assert = require('assert');
44
const http = require('http');
55

6-
function* bad() {
7-
for (let i = 0; i <= 32; i += 1)
8-
yield 'bad' + String.fromCharCode(i) + 'path';
9-
}
10-
11-
for (const path of bad()) {
6+
for (let i = 0; i <= 32; i += 1) {
7+
const path = 'bad' + String.fromCharCode(i) + 'path';
128
assert.throws(() => http.get({ path }, common.fail),
139
/contains unescaped characters/);
1410
}

0 commit comments

Comments
 (0)