]> BookStack Code Mirror - bookstack/blobdiff - app/Exports/Controllers/ChapterExportController.php
Merge pull request #5731 from BookStackApp/lexical_jul25
[bookstack] / app / Exports / Controllers / ChapterExportController.php
index 0d7a5c0d195ec94181cbacca251a632d2008e7c0..8490243439a05b9ad18aaec2325d67af368118f6 100644 (file)
@@ -16,6 +16,7 @@ class ChapterExportController extends Controller
         protected ExportFormatter $exportFormatter,
     ) {
         $this->middleware('can:content-export');
+        $this->middleware('throttle:exports');
     }
 
     /**
@@ -81,6 +82,6 @@ class ChapterExportController extends Controller
         $chapter = $this->queries->findVisibleBySlugsOrFail($bookSlug, $chapterSlug);
         $zip = $builder->buildForChapter($chapter);
 
-        return $this->download()->streamedDirectly(fopen($zip, 'r'), $chapterSlug . '.zip', filesize($zip));
+        return $this->download()->streamedFileDirectly($zip, $chapterSlug . '.zip', true);
     }
 }