Cleaned up InternalServer::handle_suggest()

As a result of this clean-up the /suggest endpoint too stopped
generating confusing 404 Not Found errors (which, like in /meta's case
is not that important). Another functional change is that the "term"
parameter became optional.
This commit is contained in:
Veloman Yunkan
2021-12-11 22:04:13 +04:00
committed by Matthieu Gautier
parent 20b5a2b971
commit 872ddd9cb3
2 changed files with 12 additions and 24 deletions

View File

@ -179,6 +179,7 @@ const ResourceCollection resources200Compressible{
{ NO_ETAG, "/search?content=zimfile&pattern=a" },
{ NO_ETAG, "/suggest?content=zimfile" },
{ NO_ETAG, "/suggest?content=zimfile&term=ray" },
{ NO_ETAG, "/catch/external?source=www.example.com" },
@ -282,7 +283,6 @@ const char* urls404[] = {
"/random?content=non-existent-book",
"/search",
"/suggest",
"/suggest?content=zimfile",
"/suggest?content=non-existent-book&term=abcd",
"/catch/external",
"/zimfile/A/non-existent-article",