Skip to content

Commit

Permalink
test: simplify test-http-client-unescaped-path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rvagg authored and MylesBorins committed Mar 9, 2017
1 parent 15231aa commit 5367336
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/parallel/test-http-client-unescaped-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/);
}

0 comments on commit 5367336

Please sign in to comment.