opc meldunge parameter fehler io
This commit is contained in:
1 parent
58338ee07c
commit
0e7b53e558
87 files changed
+1500
-8
No files matched your search
@@ -0,0 +1,8 @@
|
||||
export async function GET(request:Request,{params}:{params:Promise<{id:string}>}){
|
||||
const {id}=await params,file=new URL(request.url).searchParams.get('file')??'manifest.json';
|
||||
try{const response=await fetch('http://localhost:3000/rk2/backups/'+encodeURIComponent(id)+'/file?file='+encodeURIComponent(file),{cache:'no-store'});
|
||||
if(!response.ok)return new Response('Sicherungsdatei nicht verfügbar',{status:response.status});
|
||||
const filename=file.split('/').pop()?.replace(/[^A-Za-z0-9_.-]/g,'_')??'backup.json';
|
||||
return new Response(response.body,{headers:{'Content-Type':response.headers.get('Content-Type')??'application/json','Content-Disposition':'attachment; filename="'+filename+'"','Cache-Control':'no-store'}});
|
||||
}catch{return new Response('Keine Verbindung zum Backend',{status:502});}
|
||||
}
|
||||
Reference in new issue
Block a user