From 883553319361e8b0e36cdfdd45f87c93abebd682 Mon Sep 17 00:00:00 2001 From: Kishore Nallan Date: Fri, 4 Mar 2022 16:54:30 +0530 Subject: [PATCH] Fix CORS value case sensitivity. --- include/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/config.h b/include/config.h index c3bb6abd..f3ac45e4 100644 --- a/include/config.h +++ b/include/config.h @@ -292,7 +292,6 @@ public: this->ssl_certificate_key = get_env("TYPESENSE_SSL_CERTIFICATE_KEY"); std::string cors_value = get_env("TYPESENSE_ENABLE_CORS"); - StringUtils::tolowercase(cors_value); set_cors_parameters(cors_value); if(!get_env("TYPESENSE_MAX_MEMORY_RATIO").empty()) { @@ -559,7 +558,8 @@ public: } } - void set_cors_parameters(const std::string& cors_value) { + void set_cors_parameters(std::string& cors_value) { + StringUtils::tolowercase(cors_value); this->enable_cors = !(cors_value == "false"); if(cors_value != "true" && cors_value != "false") {