- Issue created by @mikkmiggur
- 🇫🇷France nod_ Lille
I think serving a 404 when there are no query parameter and the file doesn't already exist makes sense.
If there are query parameters the errors are there to help understand what's happening so I still think an error is a appropriate response to a malformed request.
- 🇪🇪Estonia mikkmiggur
Tested with the latest Drupal 10.1.7
[ANY D10.1 SITE]/sites/default/files/css/foo.css -> 400 "A client error happened"
Why it can't be a normal 404 file not found? 404 is a client error: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_re...
Can we improve the issue title?
- 🇮🇳India SandeepSingh199
There are two different things
1. If the path of the url is valid and the file/image name is different/wrong, on that time it will display 404 A Client Error Happened (e.g. /sites/default/files
/js/foo.jpg)
2. If the file/image name is valid but path is invalid on that time it will display 404 Not Found, the normal messages. (e.g. /sites/default/files_1
/js/foo.jpg).I think the message is okay for two different situation.
- 🇪🇪Estonia mikkmiggur
/sites/default/files/foo.jpg - This gets 404 as it should.
/sites/default/files/js/foo.jpg - This gets 400 and the client error page and Drupal writes to the logs client error. Anything not existing in the JS and CSS folder is causing that problem (/sites/default/files/js/error.exe). It's not about file types. Drupal not handling correctly not existing files in these folders.