blob: 51f8413b6752445fa7bc3c0a9a9f2e08c058249d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
'use strict';
const common = require('../common');
var assert = require('assert');
var http = require('http');
var server = http.createServer(common.mustCall(function(req, res) {
assert.equal('GET', req.method);
assert.equal('/foo?bar', req.url);
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('hello\n');
res.end();
server.close();
}));
server.listen(0, function() {
http.get(`http://127.0.0.1:${this.address().port}/foo?bar`);
});
|