File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -154,8 +154,8 @@ export async function prerender(nitro: Nitro) {
154154 } ;
155155
156156 const canWriteToDisk = ( route : PrerenderRoute ) => {
157- // Cannot write routes with query
158- if ( route . route . includes ( "?" ) ) {
157+ // Cannot write routes with query or containing ..
158+ if ( route . route . includes ( "?" ) || route . route . includes ( ".." ) ) {
159159 return false ;
160160 }
161161
@@ -291,8 +291,8 @@ export async function prerender(nitro: Nitro) {
291291 }
292292
293293 // Write to the disk
294- if ( canWriteToDisk ( _route ) ) {
295- const filePath = join ( nitro . options . output . publicDir , _route . fileName ) ;
294+ const filePath = join ( nitro . options . output . publicDir , _route . fileName ) ;
295+ if ( canWriteToDisk ( _route ) && filePath . startsWith ( nitro . options . output . publicDir ) ) {
296296 await writeFile ( filePath , dataBuff ! ) ;
297297 nitro . _prerenderedRoutes ! . push ( _route ) ;
298298 } else {
You can’t perform that action at this time.
0 commit comments