From 9c984d3215b13318275af4d48e17b09293b926a8 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Wed, 16 Jul 2025 20:33:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Inlines=20cors=20wildcard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esp32/build_settings.ini | 1 - esp32/include/spot.h | 4 ---- esp32/src/spot.cpp | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/esp32/build_settings.ini b/esp32/build_settings.ini index f76665b..14d261a 100644 --- a/esp32/build_settings.ini +++ b/esp32/build_settings.ini @@ -4,7 +4,6 @@ build_flags = -D APPLICATION_CORE=0 -D EMBED_WWW -D SERVE_CONFIG_FILES - -D CORS_ORIGIN=\"*\" -D ENABLE_CORS -D USE_MSGPACK=1 ; Use either msgpack or json diff --git a/esp32/include/spot.h b/esp32/include/spot.h index 0c17f0e..ee6e8c7 100644 --- a/esp32/include/spot.h +++ b/esp32/include/spot.h @@ -26,10 +26,6 @@ #include #endif -#ifndef CORS_ORIGIN -#define CORS_ORIGIN "*" -#endif - #ifndef APP_VERSION #define APP_VERSION "v1" #endif diff --git a/esp32/src/spot.cpp b/esp32/src/spot.cpp index bb21bd3..eafb207 100644 --- a/esp32/src/spot.cpp +++ b/esp32/src/spot.cpp @@ -160,7 +160,7 @@ void Spot::setupServer() { #if defined(ENABLE_CORS) ESP_LOGV(TAG, "Enabling CORS headers"); - DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", CORS_ORIGIN); + DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", "*"); DefaultHeaders::Instance().addHeader("Access-Control-Allow-Headers", "Accept, Content-Type, Authorization"); DefaultHeaders::Instance().addHeader("Access-Control-Allow-Credentials", "true"); #endif