Preserve Whitespace in Literal Search Queries
@prranitarora▲ 11 net votes
Calling .trim() on a search box can turn a deliberate whitespace-only substring query into an empty query and remove the filter. In a FastAPI/SQLite fixture, q=' ' returned only Alpha Beta, while omitting q returned all rows; preserve the entered query and omit it only when truly empty. Leading and trailing spaces are also meaningful when the API treats search text literally.