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

Fix for the CORS ACL headers not matching incoming ACL request headers.

Kishore Nallan5c154b2fcf70
diff --git a/docker-build.sh b/docker-build.sh
index 48e9bdd1..a0c723f0 100755
--- a/docker-build.sh
+++ b/docker-build.sh
@@ -19,7 +19,7 @@ echo "Creating development image..."
docker build --file $PROJECT_DIR/docker/development.Dockerfile --tag typesense/typesense-development:latest $PROJECT_DIR/docker
echo "Building Typesense..."
-docker run -it -v $PROJECT_DIR:/typesense typesense/typesense-development cmake -H/typesense -B/typesense/build
+docker run -it -v $PROJECT_DIR:/typesense typesense/typesense-development cmake -DCMAKE_BUILD_TYPE=Release -H/typesense -B/typesense/build
docker run -it -v $PROJECT_DIR:/typesense typesense/typesense-development make -C/typesense/build
if [[ "$@" == *"--build-deploy-image"* ]]; then
diff --git a/include/typesense_version.h b/include/typesense_version.h
index b045d9d0..61a9740b 100644
--- a/include/typesense_version.h
+++ b/include/typesense_version.h
@@ -1 +1,2 @@
-#define TYPESENSE_VERSION "0.7.1"
\ No newline at end of file
+// This would be updated by the build script when a release is built
+#define TYPESENSE_VERSION "nightly"
\ No newline at end of file
diff --git a/src/http_server.cpp b/src/http_server.cpp
index 262ae341..f2791058 100644
--- a/src/http_server.cpp
+++ b/src/http_server.cpp
@@ -290,8 +290,7 @@ int HttpServer::catch_all_handler(h2o_handler_t *_self, h2o_req_t *req) {
ssize_t acl_header_cursor = h2o_find_header_by_str(&req->headers, ACL_REQ_HEADERS, strlen(ACL_REQ_HEADERS), -1);
if(acl_header_cursor != -1) {
- h2o_iovec_t &slot = req->headers.entries[acl_header_cursor].value;
- const char* acl_req_headers = std::string(slot.base, slot.len).c_str();
+ h2o_iovec_t &acl_req_headers = req->headers.entries[acl_header_cursor].value;
h2o_generator_t generator = {NULL, NULL};
h2o_iovec_t res_body = h2o_strdup(&req->pool, "", SIZE_MAX);
@@ -306,7 +305,7 @@ int HttpServer::catch_all_handler(h2o_handler_t *_self, h2o_req_t *req) {
0, NULL, H2O_STRLIT("POST, GET, DELETE, PUT, PATCH, OPTIONS"));
h2o_add_header_by_str(&req->pool, &req->res.headers,
H2O_STRLIT("Access-Control-Allow-Headers"),
- 0, NULL, acl_req_headers, strlen(acl_req_headers));
+ 0, NULL, acl_req_headers.base, acl_req_headers.len);
h2o_add_header_by_str(&req->pool, &req->res.headers,
H2O_STRLIT("Access-Control-Max-Age"),
0, NULL, H2O_STRLIT("86400"));