mirror of
https://github.com/hanzoai/mail.git
synced 2026-09-23 23:53:02 +00:00
don't cause internal server errors for static file requests for invalid paths
eg containing %00. just treat those as "file not found", because invalid paths can't exist. based on error logging i encountered some time ago.
This commit is contained in:
+1
-1
@@ -207,7 +207,7 @@ func HandleStatic(h *config.WebStatic, compress bool, w http.ResponseWriter, r *
|
||||
|
||||
f, err := os.Open(fspath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) || errors.Is(err, syscall.ENOTDIR) {
|
||||
if os.IsNotExist(err) || errors.Is(err, syscall.ENOTDIR) || errors.Is(err, syscall.EINVAL) {
|
||||
if h.ContinueNotFound {
|
||||
// We haven't handled this request, try a next WebHandler in the list.
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user