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

Don't expose the server name in HTTP response headers.

Kishore Nallanfe6db8c46bba
diff --git a/src/api.cpp b/src/api.cpp
index 379af4f9..8b6cb27d 100644
--- a/src/api.cpp
+++ b/src/api.cpp
@@ -192,8 +192,8 @@ void get_search(http_req & req, http_res & res) {
//std::cout << "Memory usage: " << r_usage.ru_maxrss << std::endl;
res.send_200(json_str);
- long long int timeMillis = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - begin).count();
- std::cout << "Time taken: " << timeMillis << "us" << std::endl;
+ long long int timeMicros = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - begin).count();
+ std::cout << "Time taken: " << timeMicros << "us" << std::endl;
}
void post_add_document(http_req & req, http_res & res) {
diff --git a/src/http_server.cpp b/src/http_server.cpp
index 94472a0f..bcdeeff6 100644
--- a/src/http_server.cpp
+++ b/src/http_server.cpp
@@ -45,6 +45,7 @@ int HttpServer::create_listener(void) {
return -1;
}
+ ctx.globalconf->server_name = h2o_strdup(NULL, "", SIZE_MAX);
sock = h2o_evloop_socket_create(ctx.loop, fd, H2O_SOCKET_FLAG_DONT_READ);
h2o_socket_read_start(sock, on_accept);