Leuchtfeuer / typo3-secure-downloads

Secure your assets and data from unwanted download. Apply TYPO3 access rights to ALL file assets (PDFs, TGZs or JPGs etc. - configurable) - protect them from direct access.
https://www.Leuchtfeuer.com
GNU General Public License v2.0
21 stars 35 forks source link

Unnecessary/wrong code to remove in FileDelivery v5.0.6 #215

Open crealistiques opened 1 month ago

crealistiques commented 1 month ago

In my opinion, the code (line 114-126) in the FileDelivery class should be removed to get the intended functionality! https://github.com/Leuchtfeuer/typo3-secure-downloads/blob/7ef9d9b5609ba4b77a6e789c49f3030a86f3f634/Classes/Resource/FileDelivery.php#L114

The code part (lines 114-126) should simply be removed, because otherwise the use of the event in line 111 makes no sense and has no use. The event is very good for manipulating the file to be delivered, which is very handy if I want to deliver a different version of the original file, for example. But if I manipulate $file in an event listener of AfterFileRetrievedEvent, the new/modified $file will not be reflected/used in the returned response/stream!

So please remove the code if that makes sense to you.

Thank you very much for your good work and support!

balasch commented 1 month ago

Many thanks for the tip. We will take a closer look at it.