2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

fix(adapter): fix undefined reference to hasBrowserEnv (#6572)

This commit is contained in:
Antonin Bas
2024-08-23 05:23:14 -07:00
committed by GitHub
parent fed1a4b2d7
commit 7004707c41
2 changed files with 6 additions and 6 deletions
@@ -4,7 +4,6 @@
import axios from '../../../index.js';
import http from 'http';
import assert from 'assert';
import utils from '../../../lib/utils.js';
import platform from '../../../lib/platform/index.js';
@@ -52,17 +51,18 @@ describe('Server-Side Request Forgery (SSRF)', () => {
let hasBrowserEnv, origin;
before(() => {
hasBrowserEnv = utils.hasBrowserEnv;
assert.ok(platform.hasBrowserEnv !== undefined);
hasBrowserEnv = platform.hasBrowserEnv;
origin = platform.origin;
utils.hasBrowserEnv = true;
platform.hasBrowserEnv = true;
platform.origin = 'http://localhost:' + String(GOOD_PORT);
});
after(() => {
utils.hasBrowserEnv = hasBrowserEnv;
platform.hasBrowserEnv = hasBrowserEnv;
platform.origin = origin;
});
it('should fetch in client-side mode', async () => {
utils.hasBrowserEnv = true;
platform.hasBrowserEnv = true;
const ssrfAxios = axios.create({
baseURL: 'http://localhost:' + String(GOOD_PORT),
});