File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 233
233
Route::post ('/upload/backup/{databaseUuid} ' , [UploadController::class, 'upload ' ])->name ('upload.backup ' );
234
234
Route::get ('/download/backup/{executionId} ' , function () {
235
235
try {
236
+ ray ()->clearAll ();
236
237
$ team = auth ()->user ()->currentTeam ();
237
238
if (is_null ($ team )) {
238
239
return response ()->json (['message ' => 'Team not found. ' ], 404 );
264
265
'port ' => $ server ->port ,
265
266
'username ' => $ server ->user ,
266
267
'privateKey ' => $ privateKeyLocation ,
268
+ 'root ' => '/ ' ,
267
269
]);
270
+ if (! $ disk ->exists ($ filename )) {
271
+ return response ()->json (['message ' => 'Backup not found. ' ], 404 );
272
+ }
268
273
269
274
return new StreamedResponse (function () use ($ disk , $ filename ) {
270
275
if (ob_get_level ()) {
271
276
ob_end_clean ();
272
277
}
273
278
$ stream = $ disk ->readStream ($ filename );
274
- if ($ stream === false ) {
279
+ if ($ stream === false || is_null ( $ stream ) ) {
275
280
abort (500 , 'Failed to open stream for the requested file. ' );
276
281
}
277
282
while (! feof ($ stream )) {
You can’t perform that action at this time.
0 commit comments