11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst http = require('http'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ci// Test providing both a url and options, with the options partially 71cb0ef41Sopenharmony_ci// replacing address and port portions of the URL provided. 81cb0ef41Sopenharmony_ci{ 91cb0ef41Sopenharmony_ci const server = http.createServer( 101cb0ef41Sopenharmony_ci common.mustCall((req, res) => { 111cb0ef41Sopenharmony_ci assert.strictEqual(req.url, '/testpath'); 121cb0ef41Sopenharmony_ci res.end(); 131cb0ef41Sopenharmony_ci server.close(); 141cb0ef41Sopenharmony_ci }) 151cb0ef41Sopenharmony_ci ); 161cb0ef41Sopenharmony_ci server.listen( 171cb0ef41Sopenharmony_ci 0, 181cb0ef41Sopenharmony_ci common.mustCall(() => { 191cb0ef41Sopenharmony_ci http.get( 201cb0ef41Sopenharmony_ci 'http://example.com/testpath', 211cb0ef41Sopenharmony_ci { hostname: 'localhost', port: server.address().port }, 221cb0ef41Sopenharmony_ci common.mustCall((res) => { 231cb0ef41Sopenharmony_ci res.resume(); 241cb0ef41Sopenharmony_ci }) 251cb0ef41Sopenharmony_ci ); 261cb0ef41Sopenharmony_ci }) 271cb0ef41Sopenharmony_ci ); 281cb0ef41Sopenharmony_ci} 29