File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
229229
230230 // Parse url
231231 const fullPath = buildFullPath ( config . baseURL , config . url ) ;
232- const parsed = new URL ( fullPath , utils . hasBrowserEnv ? platform . origin : undefined ) ;
232+ const parsed = new URL ( fullPath , platform . hasBrowserEnv ? platform . origin : undefined ) ;
233233 const protocol = parsed . protocol || supportedProtocols [ 0 ] ;
234234
235235 if ( protocol === 'data:' ) {
Original file line number Diff line number Diff line change 44import axios from '../../../index.js' ;
55import http from 'http' ;
66import assert from 'assert' ;
7- import utils from '../../../lib/utils.js' ;
87import platform from '../../../lib/platform/index.js' ;
98
109
@@ -52,17 +51,18 @@ describe('Server-Side Request Forgery (SSRF)', () => {
5251 let hasBrowserEnv , origin ;
5352
5453 before ( ( ) => {
55- hasBrowserEnv = utils . hasBrowserEnv ;
54+ assert . ok ( platform . hasBrowserEnv !== undefined ) ;
55+ hasBrowserEnv = platform . hasBrowserEnv ;
5656 origin = platform . origin ;
57- utils . hasBrowserEnv = true ;
57+ platform . hasBrowserEnv = true ;
5858 platform . origin = 'http://localhost:' + String ( GOOD_PORT ) ;
5959 } ) ;
6060 after ( ( ) => {
61- utils . hasBrowserEnv = hasBrowserEnv ;
61+ platform . hasBrowserEnv = hasBrowserEnv ;
6262 platform . origin = origin ;
6363 } ) ;
6464 it ( 'should fetch in client-side mode' , async ( ) => {
65- utils . hasBrowserEnv = true ;
65+ platform . hasBrowserEnv = true ;
6666 const ssrfAxios = axios . create ( {
6767 baseURL : 'http://localhost:' + String ( GOOD_PORT ) ,
6868 } ) ;
You can’t perform that action at this time.
0 commit comments