🎨 Inlines cors wildcard
This commit is contained in:
@@ -4,7 +4,6 @@ build_flags =
|
|||||||
-D APPLICATION_CORE=0
|
-D APPLICATION_CORE=0
|
||||||
-D EMBED_WWW
|
-D EMBED_WWW
|
||||||
-D SERVE_CONFIG_FILES
|
-D SERVE_CONFIG_FILES
|
||||||
-D CORS_ORIGIN=\"*\"
|
|
||||||
-D ENABLE_CORS
|
-D ENABLE_CORS
|
||||||
|
|
||||||
-D USE_MSGPACK=1 ; Use either msgpack or json
|
-D USE_MSGPACK=1 ; Use either msgpack or json
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
#include <WWWData.h>
|
#include <WWWData.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CORS_ORIGIN
|
|
||||||
#define CORS_ORIGIN "*"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef APP_VERSION
|
#ifndef APP_VERSION
|
||||||
#define APP_VERSION "v1"
|
#define APP_VERSION "v1"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -160,7 +160,7 @@ void Spot::setupServer() {
|
|||||||
|
|
||||||
#if defined(ENABLE_CORS)
|
#if defined(ENABLE_CORS)
|
||||||
ESP_LOGV(TAG, "Enabling CORS headers");
|
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-Headers", "Accept, Content-Type, Authorization");
|
||||||
DefaultHeaders::Instance().addHeader("Access-Control-Allow-Credentials", "true");
|
DefaultHeaders::Instance().addHeader("Access-Control-Allow-Credentials", "true");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user