File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change 330330 let xLoadable ;
331331 if ( contextUrl . startsWith ( "file:" ) ) {
332332 const contextDir = contextUrl . replace ( / [ ^ \/ ] * $ / , '' ) ;
333- const urls = [ ...policy . sites . keys ( ) ] . filter ( u => / ^ f i l e : \/ \/ . * \/ / . test ( u ) ) ;
333+ const urls = [ ...policy . sites . keys ( ) ] . filter ( u => / ^ f i l e : / . test ( u ) ) ;
334334 xLoadable = urls . filter ( u =>
335335 policy . get ( u , contextDir ) ?. perms ?. capabilities . has ( "x-load" ) ) ;
336336 }
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ const FILE_OR_FTP = /^(?:file|ftp):$/.test(location.protocol);
178178 } ,
179179
180180 canXLoad ( url ) {
181- return this . policy ?. xLoadable ?. includes ( url . replace ( / [ ^ / ] + $ / , "" ) ) ;
181+ return this . policy ?. xLoadable ?. some ( parentDir => url . startsWith ( parentDir ) ) ;
182182 }
183183 } ;
184184 globalThis . ns = globalThis . ns ? Object . assign ( ns , globalThis . ns ) : ns ;
You can’t perform that action at this time.
0 commit comments