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
C++ algoliadatastoreelasticsearchenterprise-searchfacetingfull-text-searchfuzzy-searchgeosearchin-memoryinstantsearchmerchandisingpineconesearchsearch-enginesemantic-searchsimilarity-searchsite-searchsynonymstypo-tolerancevector-search
Rely only on HTTP header for authentication.
Kishore Nallan80057b90718e
diff --git a/src/api.cpp b/src/api.cppindex e60cf524..2e7e4618 100644--- a/src/api.cpp+++ b/src/api.cpp@@ -32,11 +32,9 @@ nlohmann::json collection_summary_json(Collection *collection) {bool handle_authentication(const route_path & rpath, const std::string & auth_key) {CollectionManager & collectionManager = CollectionManager::get_instance();- if(rpath.handler == get_search) {- return collectionManager.auth_key_matches(auth_key) || collectionManager.search_only_auth_key_matches(auth_key);- }- return collectionManager.auth_key_matches(auth_key);+ return collectionManager.auth_key_matches(auth_key) ||+ (rpath.handler == get_search && collectionManager.search_only_auth_key_matches(auth_key))}void get_collections(http_req & req, http_res & res) {diff --git a/src/http_server.cpp b/src/http_server.cppindex c3376f02..cad4b47b 100644--- a/src/http_server.cpp+++ b/src/http_server.cpp@@ -440,7 +440,7 @@ void HttpServer::stream_response(void (*handler)(http_req* req, http_res* res, vint HttpServer::send_401_unauthorized(h2o_req_t *req) {h2o_generator_t generator = {NULL, NULL};std::string res_body = std::string("{\"message\": \"Forbidden - a valid `") + AUTH_HEADER +- "` header or GET parameter must be sent.\"}";+ "` header must be sent.\"}";h2o_iovec_t body = h2o_strdup(&req->pool, res_body.c_str(), SIZE_MAX);req->res.status = 401;req->res.reason = get_status_reason(req->res.status);