Index: clinkc/include/cybergarage/http/chttp.h =================================================================== --- clinkc.orig/include/cybergarage/http/chttp.h 2018-11-19 14:33:59.334336475 +0800 +++ clinkc/include/cybergarage/http/chttp.h 2018-11-19 14:42:17.102346023 +0800 @@ -363,6 +363,10 @@ extern BOOL bRemoveDaemonsWirelessModule; +#ifdef ZYXEL_PATCH +void enableCrossSiteDebug(); +#endif + /**************************************** * Function ****************************************/ Index: clinkc/src/cybergarage/http/chttp_packet.c =================================================================== --- clinkc.orig/src/cybergarage/http/chttp_packet.c 2018-11-19 14:33:59.238336473 +0800 +++ clinkc/src/cybergarage/http/chttp_packet.c 2018-11-19 14:42:24.854973821 +0800 @@ -64,6 +64,13 @@ BOOL bRemoveDaemonsWirelessModule = FALSE; +#ifdef ZYXEL_PATCH +BOOL crossSiteDebug = false; + +void enableCrossSiteDebug(){ + crossSiteDebug = true; +} +#endif static int memory_check(int buflen, char *remoteIP); /**************************************** @@ -346,11 +353,13 @@ cg_log_debug_l4("Entering...\n"); -#ifdef ZYXEL_CROSS_SITE_DEBUG - cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Origin", "*"); - cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Methods", "*"); - //cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Headers", "*"); - //cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Credentials", "true"); +#ifdef ZYXEL_PATCH + if(crossSiteDebug){ + cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Origin", "*"); + cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Methods", "*"); + //cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Headers", "*"); + //cg_http_headerlist_set(httpPkt->headerList, "Access-Control-Allow-Credentials", "true"); + } #endif /**** send headers ****/