File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,15 +13,21 @@ var form = new FormData();
1313form . 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 ( ) { } ) ;
1717assert . strictEqual ( req . path , '/path' ) ;
1818assert . 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 ( ) { } ) ;
1924assert . strictEqual ( req . getHeader ( 'Host' ) , 'localhost:' + common . port ) ;
2025req . abort ( ) ;
2126
2227// HTTPS protocol handling
23- req = form . submit ( 'https://localhost:' + common . port + ' /path', function ( ) { } ) ;
28+ req = form . submit ( 'https://localhost/path' , function ( ) { } ) ;
2429assert . ok ( req . agent instanceof https . Agent , 'req.agent instanceof https.Agent' ) ;
30+ assert . strictEqual ( req . getHeader ( 'Host' ) , 'localhost' ) ;
2531req . abort ( ) ;
2632
2733
You can’t perform that action at this time.
0 commit comments