mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-10-24 09:59:24 -04:00
Return http 400 error response when needed.
This commit is contained in:
1 parent
b1643e422e
commit
e7293346be
2 files changed
+87
-17
No files matched your search
@@ -526,8 +526,13 @@ std::unique_ptr<Response> InternalServer::handle_search(const RequestContext& re
|
||||
} catch (const std::out_of_range&) {}
|
||||
|
||||
/* Make the search */
|
||||
if ( (!archive && !bookName.empty())
|
||||
|| (patternString.empty() && ! has_geo_query) ) {
|
||||
if (patternString.empty() && ! has_geo_query) {
|
||||
return HTTP400HtmlResponse(*this, request)
|
||||
+ invalidUrlMsg
|
||||
+ std::string("No query provided.");
|
||||
}
|
||||
|
||||
if (!archive && !bookName.empty()) {
|
||||
auto data = get_default_data();
|
||||
data.set("pattern", encodeDiples(patternString));
|
||||
data.set("root", m_root);
|
||||
|
||||
Reference in new issue
Block a user