stable

Clone or download

Read-only

Reject download of the zip when its size exceeds the maximum limit

Part of story #12404 download folder as zip How to test: Test with the following curl command. <tags> need to be replaced by your values: $ curl -k -v --cookie \ "__Host-TULEAP_PHPSESSID=<your_php_sessid_cookie>" --cookie \ "__Host-TULEAP_session_hash=<your_session_hash_cookie>" \ https://<your_tuleap_host>/plugins/document/<your_project_name>/folders/<your_folder_id>/download-folder-as-zip - When the folder has a size <= to the maximum limit (default 2000MB), download will proceed and you get code 200 (curl will warn you with "Warning: Binary output can mess up your terminal."). - When the folder has a size > to the maximum limit, you get a 403 Forbidden error and the response is html instead of zip. Change-Id: I4f7f843ffc1a2ba70aeb128f08ca0074addbb911

Modified Files

Name
M plugins/document/include/DownloadFolderAsZip/DocumentFolderZipStreamer.php +34 −7 Go to diff View file
A plugins/document/include/DownloadFolderAsZip/FolderSizeIsAllowedChecker.php +51 −0 Go to diff View file
M plugins/document/include/documentPlugin.php +5 −1 Go to diff View file
M plugins/document/tests/unit/DownloadFolderAsZip/DocumentFolderZipStreamerTest.php +7 −2 Go to diff View file
A plugins/document/tests/unit/DownloadFolderAsZip/FolderSizeIsAllowedCheckerTest.php +69 −0 Go to diff View file