Skip to content

Commit eec0e80

Browse files
committed
update tests for url parsing
1 parent c0390dc commit eec0e80

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/integration/test-submit-url-parsing.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,21 @@ var form = new FormData();
1313
form.append('field', 'value');
1414

1515
// Basic parsing
16-
req = form.submit('http://localhost:' + common.port + '/path', function() {});
16+
req = form.submit('http://localhost/path', function() {});
1717
assert.strictEqual(req.path, '/path');
1818
assert.ok(req.agent instanceof http.Agent, 'req.agent instanceof http.Agent');
19+
assert.strictEqual(req.getHeader('Host'), 'localhost');
20+
req.abort();
21+
22+
// Non-default port handling
23+
req = form.submit('http://localhost:' + common.port, function() {});
1924
assert.strictEqual(req.getHeader('Host'), 'localhost:' + common.port);
2025
req.abort();
2126

2227
// HTTPS protocol handling
23-
req = form.submit('https://localhost:' + common.port + '/path', function() {});
28+
req = form.submit('https://localhost/path', function() {});
2429
assert.ok(req.agent instanceof https.Agent, 'req.agent instanceof https.Agent');
30+
assert.strictEqual(req.getHeader('Host'), 'localhost');
2531
req.abort();
2632

2733

0 commit comments

Comments
 (0)