2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

chore(tests): fixed tests to pass in node v19 and v20 with keep-alive enabled; (#6021)

This commit is contained in:
Dmitriy Mozgovoy
2023-10-22 18:20:44 +03:00
committed by GitHub
parent 5aaff532a6
commit 7d45ab2e2a
4 changed files with 83 additions and 80 deletions
@@ -20,8 +20,9 @@ describe('Server-Side Request Forgery (SSRF)', () => {
fail = true;
res.end('rm -rf /');
}).listen(EVIL_PORT);
proxy = http.createServer(function (req, res) {
if (req.url === 'http://localhost:' + EVIL_PORT + '/') {
if (new URL(req.url, 'http://' + req.headers.host).toString() === 'http://localhost:' + EVIL_PORT + '/') {
return res.end(JSON.stringify({
msg: 'Protected',
headers: req.headers,
@@ -35,8 +36,10 @@ describe('Server-Side Request Forgery (SSRF)', () => {
server.close();
proxy.close();
});
it('obeys proxy settings when following redirects', async () => {
location = 'http://localhost:' + EVIL_PORT;
let response = await axios({
method: "get",
url: "http://www.google.com/",