Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Insist on API key authentication even for search end-point.

kishorencc7eb19ca466b
diff --git a/include/collection_manager.h b/include/collection_manager.h
index 0d2d7648..ce8cdb9a 100644
--- a/include/collection_manager.h
+++ b/include/collection_manager.h
@@ -71,7 +71,7 @@ public:
bool auth_key_matches(std::string auth_key_sent);
- bool search_only_auth_key_matches(std::string auth_key_sent);
+ bool search_only_auth_key_matches(const std::string & auth_key_sent);
Option<Collection*> create_collection(const std::string name, const std::vector<field> & fields,
const std::string & default_sorting_field,
diff --git a/src/collection_manager.cpp b/src/collection_manager.cpp
index d3ff8e3b..8c070dc0 100644
--- a/src/collection_manager.cpp
+++ b/src/collection_manager.cpp
@@ -200,8 +200,8 @@ bool CollectionManager::auth_key_matches(std::string auth_key_sent) {
return (auth_key == auth_key_sent);
}
-bool CollectionManager::search_only_auth_key_matches(std::string auth_key_sent) {
- return (search_only_auth_key == auth_key_sent);
+bool CollectionManager::search_only_auth_key_matches(const std::string & auth_key_sent) {
+ return !auth_key_sent.empty() && (search_only_auth_key == auth_key_sent);
}
Option<Collection*> CollectionManager::create_collection(const std::string name, const std::vector<field> & fields,