|
|
@ -25,6 +25,13 @@ s.on('/relative', function (req, res) { |
|
|
|
res.end(); |
|
|
|
}); |
|
|
|
|
|
|
|
s.on('/relativeQuery?bang', function (req, res) { |
|
|
|
res.writeHead(302, { |
|
|
|
location: '/' |
|
|
|
}); |
|
|
|
res.end(); |
|
|
|
}); |
|
|
|
|
|
|
|
s.on('/', function (req, res) { |
|
|
|
res.end('reached'); |
|
|
|
}); |
|
|
@ -59,6 +66,14 @@ tape('throws on endless redirect', function (t) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
tape('query in options are not breaking redirects', function (t) { |
|
|
|
got(s.url + '/relativeQuery', {query: 'bang'}, function (err, data) { |
|
|
|
t.error(err); |
|
|
|
t.equal(data, 'reached'); |
|
|
|
t.end(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
tape('host+path in options are not breaking redirects', function (t) { |
|
|
|
got(s.url + '/relative', {host: s.url, path: '/relative'}, function (err, data) { |
|
|
|
t.error(err); |
|
|
|