mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Add search form for /nojs endpoint
Adds an html form to search books by the q= parameter
This commit is contained in:
@ -783,7 +783,8 @@ std::unique_ptr<Response> InternalServer::handle_no_js(const RequestContext& req
|
||||
std::string content;
|
||||
|
||||
if (urlParts.size() == 1) {
|
||||
content = htmlDumper.dumpPlainHTML();
|
||||
const auto filter = get_search_filter(request);
|
||||
content = htmlDumper.dumpPlainHTML(filter);
|
||||
} else if ((urlParts.size() == 3) && (urlParts[1] == "download")) {
|
||||
try {
|
||||
const auto bookId = mp_nameMapper->getIdForName(urlParts[2]);
|
||||
@ -797,7 +798,6 @@ std::unique_ptr<Response> InternalServer::handle_no_js(const RequestContext& req
|
||||
+ urlNotFoundMsg;
|
||||
}
|
||||
|
||||
|
||||
return ContentResponse::build(
|
||||
*this,
|
||||
content,
|
||||
|
Reference in New Issue
Block a user