Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

queries with slashes don't work #2

Closed
vthriller opened this issue Apr 23, 2020 · 2 comments
Closed

queries with slashes don't work #2

vthriller opened this issue Apr 23, 2020 · 2 comments

Comments

@vthriller
Copy link

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.)

@DavidMStraub
Copy link
Owner

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?

@vthriller
Copy link
Author

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants