1 var http = require('http')
2 , assert = require('assert')
3 , request = require('../index')
12 var s1 = http.createServer(function (req, resp) {
13 if (req.url == '/original') {
14 resp.writeHeader(302, {'location': '/redirected'})
16 } else if (req.url == '/redirected') {
17 resp.writeHeader(200, {'content-type': 'text/plain'})
26 var s2 = http.createServer(function (req, resp) {
27 var x = request('http://localhost:'+portOne+'/original')
31 }).listen(portTwo, function () {
32 var r = request('http://localhost:'+portTwo+'/original', function (err, res, body) {
33 assert.equal(body, 'OK')
39 // it hangs, so wait a second :)