(May 10, 2019 04:04 PM)Nachfolger Wrote: I was trying to avoid coming back to this thread, but I feel as if your response yields an opposite opinion.
The topics you cover are pretty ignorant of obvious security aspects. I can't speak to your personal experiences, but within my own experience, it would be awfully negligent to not protect user uploads. Static content or not, users and their uploads deserve to be protected. I'm not sure anyone made the claim that using PHP to serve a file would be more efficient than the web server, but you seem to be basing your argument solely for the purpose of efficiency. The good news is, you won't need to worry about the extra overhead of serving files when all of your user's uploads get leaked and they all abandon whatever project you're referencing.
Acknowledging that this thread is in the PHP Subforum, no one truly made the claim that PHP is the only backend solution. If you think PHP consumes too many resources, there's always C++/Java/Node/Python/Lua. I'm sure you can find the time to benchmark them and pick the best solution over PHP.
As a side note, just because Facebook and Discord don't have permission validation before serving files, doesn't really mean that there aren't legitimate reasons or applications to do so. Besides, taking into account Facebook's recent history in terms of their privacy and security, are they truly the best example for this?
i cbb explaining myself, but imma say we're both wrong and right. there are edge cases for both our points.
avatars (pictures publicly accessible) - should be handled by web server.
files/images sent between two people - should be permission checked.
they just two examples. it depends on what you're doing. there can be exceptions to both of the two things mentioned.
anyway, at the end of the day, who cares? I'm going to continue coding my way, you're going to continue coding your way.



