Browse Source

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>
v4.x
Rod Vagg 8 years ago
committed by Myles Borins
parent
commit
536733697c
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 8
      test/parallel/test-http-client-unescaped-path.js

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

@ -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…
Cancel
Save