[PR #140] [MERGED] fix: don't search on empty query string #489

Closed
opened 2026-04-08 16:53:08 +03:00 by zhus · 0 comments
Owner

📋 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: mainHead: main


📝 Commits (2)

📊 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.
blankline

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.

## 📋 Pull Request Information **Original PR:** https://github.com/sigoden/dufs/pull/140 **Author:** [@davidpolitis](https://github.com/davidpolitis) **Created:** 10/22/2022 **Status:** ✅ Merged **Merged:** 11/10/2022 **Merged by:** [@sigoden](https://github.com/sigoden) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`c6f5099`](https://github.com/sigoden/dufs/commit/c6f50993f415d4f6b0f18f72dc67a7dacd5761b3) fix: don't search on empty query string - [`9260064`](https://github.com/sigoden/dufs/commit/92600647f98f529d02bd2702ed60496efc8afbf4) refactor ### 📊 Changes **3 files changed** (+43 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `assets/index.html` (+1 -1) 📝 `src/server.rs` (+33 -31) 📝 `tests/http.rs` (+9 -0) </details> ### 📄 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. ![blankline](https://user-images.githubusercontent.com/13181863/197298718-036c05f8-9f1e-4ca5-91fd-15ef55794399.png) It may be best to also call .trim() before .is_empty() if it's felt that searching for simply whitespaces should be disabled. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-04-08 16:53:08 +03:00
zhus closed this issue 2026-04-08 16:53:08 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#489