DavidMStraub / netviel

Web interface for the notmuch e-mail system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

queries with slashes don't work

vthriller opened this issue · comments

Queries like mimetype:text/plain yield requests like GET /api/query/mimetype%3Atext%2Fplain which return main page instead of proper search results.

AFAIR the only proper way to fix that is to switch to query parameters, like ?q=mimetype%3Atext%2Fplain. (I'm not going to send any pull requests though because that would require changes on the front-end side as well, and I don't want to spend a lot of time diving into the npm ecosystem, sorry.)

Thanks for reporting!

At first sight it should be enough to simply urllib.parse.unquote the query string in the backend,
https://github.com/DavidMStraub/netviel/blob/master/netviel/api.py#L84
or why do you think it requires front-end changes?

It doesn't even get routed to the Query.get:

$ curl -s http://127.0.0.1:5000/api/query/mimetype%3Atext%2Fplain | head -c 150; echo
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta