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>
v6
Rod Vagg 8 years ago
committed by Anna Henningsen
parent
commit
dbf4bf2bec
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  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