@@ -25,6 +25,8 @@ <h2>Unsafe Fetch</h2>
25
25
< pre class ="unsafe-fetch-8498-2 "> </ pre >
26
26
< pre class ="unsafe-fetch-import-inline-status "> </ pre >
27
27
< pre class ="unsafe-fetch-raw-query-import-status "> </ pre >
28
+ < pre class ="unsafe-fetch-query-dot-svg-import-status "> </ pre >
29
+ < pre class ="unsafe-fetch-svg-status "> </ pre >
28
30
29
31
< h2 > Safe /@fs/ Fetch</ h2 >
30
32
< pre class ="safe-fs-fetch-status "> </ pre >
@@ -49,13 +51,15 @@ <h2>Unsafe /@fs/ Fetch</h2>
49
51
< pre class ="unsafe-fs-fetch-8498-2 "> </ pre >
50
52
< pre class ="unsafe-fs-fetch-import-inline-status "> </ pre >
51
53
< pre class ="unsafe-fs-fetch-import-inline-wasm-init-status "> </ pre >
54
+ < pre class ="unsafe-fs-fetch-relative-path-after-query-status "> </ pre >
52
55
53
56
< h2 > Nested Entry</ h2 >
54
57
< pre class ="nested-entry "> </ pre >
55
58
56
59
< h2 > Denied</ h2 >
57
60
< pre class ="unsafe-dotenv "> </ pre >
58
61
< pre class ="unsafe-dotEnV-casing "> </ pre >
62
+ < pre class ="unsafe-dotenv-query-dot-svg-wasm-init "> </ pre >
59
63
60
64
< script type ="module ">
61
65
import '../../entry'
@@ -182,6 +186,24 @@ <h2>Denied</h2>
182
186
console . error ( e )
183
187
} )
184
188
189
+ // outside of allowed dir with .svg query import
190
+ fetch ( joinUrlSegments ( base , '/unsafe.txt?.svg?import' ) )
191
+ . then ( ( r ) => {
192
+ text ( '.unsafe-fetch-query-dot-svg-import-status' , r . status )
193
+ } )
194
+ . catch ( ( e ) => {
195
+ console . error ( e )
196
+ } )
197
+
198
+ // svg outside of allowed dir, treated as unsafe
199
+ fetch ( joinUrlSegments ( base , '/unsafe.svg?import' ) )
200
+ . then ( ( r ) => {
201
+ text ( '.unsafe-fetch-svg-status' , r . status )
202
+ } )
203
+ . catch ( ( e ) => {
204
+ console . error ( e )
205
+ } )
206
+
185
207
// imported before, should be treated as safe
186
208
fetch ( joinUrlSegments ( base , joinUrlSegments ( '/@fs/' , ROOT ) + '/safe.json' ) )
187
209
. then ( ( r ) => {
@@ -298,6 +320,21 @@ <h2>Denied</h2>
298
320
console . error ( e )
299
321
} )
300
322
323
+ // outside of root with relative path after query
324
+ fetch (
325
+ joinUrlSegments (
326
+ base ,
327
+ joinUrlSegments ( '/@fs/' , ROOT ) +
328
+ '/root/src/?/../../unsafe.txt?import&raw' ,
329
+ ) ,
330
+ )
331
+ . then ( ( r ) => {
332
+ text ( '.unsafe-fs-fetch-relative-path-after-query-status' , r . status )
333
+ } )
334
+ . catch ( ( e ) => {
335
+ console . error ( e )
336
+ } )
337
+
301
338
// outside root with special characters #8498
302
339
fetch (
303
340
joinUrlSegments (
@@ -368,6 +405,20 @@ <h2>Denied</h2>
368
405
console . error ( e )
369
406
} )
370
407
408
+ // .env with .svg?.wasm?init
409
+ fetch (
410
+ joinUrlSegments (
411
+ base ,
412
+ joinUrlSegments ( '/@fs/' , ROOT ) + '/root/src/.env?.svg?.wasm?init' ,
413
+ ) ,
414
+ )
415
+ . then ( ( r ) => {
416
+ text ( '.unsafe-dotenv-query-dot-svg-wasm-init' , r . status )
417
+ } )
418
+ . catch ( ( e ) => {
419
+ console . error ( e )
420
+ } )
421
+
371
422
function text ( sel , text ) {
372
423
document . querySelector ( sel ) . textContent = text
373
424
}
0 commit comments