]> BookStack Code Mirror - bookstack/blobdiff - app/Exports/Controllers/BookExportController.php
Opensearch: Fixed XML declaration when php short tags enabled
[bookstack] / app / Exports / Controllers / BookExportController.php
index f726175a086acab697ce6e05575f69f90b58be8f..67247598c318b8e8de6e681994b5a4c9190c8c71 100644 (file)
@@ -16,6 +16,7 @@ class BookExportController extends Controller
         protected ExportFormatter $exportFormatter,
     ) {
         $this->middleware('can:content-export');
+        $this->middleware('throttle:exports');
     }
 
     /**
@@ -75,6 +76,6 @@ class BookExportController extends Controller
         $book = $this->queries->findVisibleBySlugOrFail($bookSlug);
         $zip = $builder->buildForBook($book);
 
-        return $this->download()->streamedDirectly(fopen($zip, 'r'), $bookSlug . '.zip', filesize($zip));
+        return $this->download()->streamedFileDirectly($zip, $bookSlug . '.zip', true);
     }
 }