mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[PR #140] [MERGED] fix: don't search on empty query string #489
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/sigoden/dufs/pull/140
Author: @davidpolitis
Created: 10/22/2022
Status: ✅ Merged
Merged: 11/10/2022
Merged by: @sigoden
Base:
main← Head:main📝 Commits (2)
c6f5099fix: don't search on empty query string9260064refactor📊 Changes
3 files changed (+43 additions, -32 deletions)
View changed files
📝
assets/index.html(+1 -1)📝
src/server.rs(+33 -31)📝
tests/http.rs(+9 -0)📄 Description
Submitting empty searches was calling handle_search_dir() instead of simply returning the index, returning in a blank line in the results and potentially causing hanging or crashing in large directory trees.

It may be best to also call .trim() before .is_empty() if it's felt that searching for simply whitespaces should be disabled.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.