]> BookStack Code Mirror - bookstack/blobdiff - app/Exports/Controllers/ChapterExportController.php
Readme: Swapped codeclimate reference for custom phpmetrics
[bookstack] / app / Exports / Controllers / ChapterExportController.php
index 4748ca6a80a4ce3d93aeea5068d5b055fc3538bc..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()->streamedFileDirectly($zip, $chapterSlug . '.zip', filesize($zip), true);
+        return $this->download()->streamedFileDirectly($zip, $chapterSlug . '.zip', true);
     }
 }