> @julian כתב:
>
> > @AMAARETS said:
> >
> > Just a quick question - I'm wondering what information I'm missing here
> > Why maintain a list of aliases, and not do the comparison by checking in reverse whether mime.getExtension(application/x-zip-compressed) returns a valid extension like ZIP
>
> If you check in reverse, then you are relying on the sender to supply you with the information. That's untrustworthy data — you can't guarantee someone didn't mess around with the data in between, or pretend that they're upload a jpg when it's actually an exe, etc.
How is this worse than the test that is being performed now? It also relies, among other things, on a comparison of the MIME coming from the user and the MIME checked on the server.
I just suggest replacing the manual map you added with a function that will automatically generate it by grouping all types that return the same result in mime.getExtension