Skip to content

Commit

Permalink
Style changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeal committed Mar 13, 2013
1 parent 8a45365 commit 32cfd3c
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions tests/test-piped-redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ var portOne = 8968


// server one
var s1 = http.createServer(function (req, resp)
{
if (req.url == '/original')
{
var s1 = http.createServer(function (req, resp) {
if (req.url == '/original') {
resp.writeHeader(302, {'location': '/redirected'})
resp.end()
}
else if (req.url == '/redirected')
{
} else if (req.url == '/redirected') {
resp.writeHeader(200, {'content-type': 'text/plain'})
resp.write('OK')
resp.end()
Expand All @@ -27,26 +23,20 @@ var s1 = http.createServer(function (req, resp)


// server two
var s2 = http.createServer(function (req, resp)
{

var s2 = http.createServer(function (req, resp) {
var x = request('http://localhost:'+portOne+'/original')
req.pipe(x)
x.pipe(resp)

}).listen(portTwo, function()
{

}).listen(portTwo, function () {
var r = request('http://localhost:'+portTwo+'/original', function (err, res, body) {

assert.equal(body, 'OK')

s1.close()
s2.close()

});

// it hangs, so wait a second :)
r.timeout = 1000;

});
})

0 comments on commit 32cfd3c

Please sign in to comment.