mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
API CORS = *
This commit is contained in:
@@ -3,4 +3,5 @@
|
|||||||
-DWiz5100
|
-DWiz5100
|
||||||
#-DPID_DISABLE
|
#-DPID_DISABLE
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
-DARDUINO_OTA_MDNS_DISABLE
|
-DARDUINO_OTA_MDNS_DISABLE
|
||||||
-DMDNS_ENABLE
|
-DMDNS_ENABLE
|
||||||
-DMCP23017
|
-DMCP23017
|
||||||
-DCORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
-DTIMER_INT
|
-DTIMER_INT
|
||||||
|
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
|
|||||||
@@ -46,5 +46,10 @@
|
|||||||
-DFS_PREPARE
|
-DFS_PREPARE
|
||||||
|
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
#-D CORS=\"http://lazyhome.ru\"
|
||||||
-DOTA_PORT=80
|
-DOTA_PORT=80
|
||||||
|
|
||||||
|
-DMQTT_KEEPALIVE=10
|
||||||
|
-DMQTT_SOCKET_TIMEOUT=20
|
||||||
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
@@ -17,7 +17,8 @@
|
|||||||
-DFS_PREPARE
|
-DFS_PREPARE
|
||||||
|
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
#-D CORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
-DOTA_PORT=80
|
-DOTA_PORT=80
|
||||||
|
|
||||||
#oct22 - violation in Publish/OnMQTTConnect while publish homie info
|
#oct22 - violation in Publish/OnMQTTConnect while publish homie info
|
||||||
|
|||||||
@@ -34,5 +34,7 @@
|
|||||||
#-DdebugSerialPort=Serial
|
#-DdebugSerialPort=Serial
|
||||||
|
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
#-D CORS=\"http://lazyhome.ru\"
|
||||||
-DOTA_PORT=80
|
-DOTA_PORT=80
|
||||||
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
@@ -19,5 +19,6 @@
|
|||||||
|
|
||||||
-DOTA
|
-DOTA
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
-DOTA_PORT=80
|
-DOTA_PORT=80
|
||||||
@@ -7,5 +7,6 @@
|
|||||||
-DMDNS_ENABLE
|
-DMDNS_ENABLE
|
||||||
|
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
-DOTA_PORT=80
|
-DOTA_PORT=80
|
||||||
@@ -7,5 +7,6 @@
|
|||||||
-DMDNS_ENABLE
|
-DMDNS_ENABLE
|
||||||
|
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
-DOTA_PORT=80
|
-DOTA_PORT=80
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
-DMDNS_ENABLE
|
-DMDNS_ENABLE
|
||||||
|
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
|
|
||||||
# Example of UARTBRIDGE configuration
|
# Example of UARTBRIDGE configuration
|
||||||
#-DUARTBRIDGE_ENABLE
|
#-DUARTBRIDGE_ENABLE
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
-DARDUINO_OTA_MDNS_DISABLE
|
-DARDUINO_OTA_MDNS_DISABLE
|
||||||
#-DMDNS_ENABLE
|
#-DMDNS_ENABLE
|
||||||
-DRESTART_LAN_ON_MQTT_ERRORS
|
-DRESTART_LAN_ON_MQTT_ERRORS
|
||||||
-D CORS=\"http://lazyhome.ru\"
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
-DOTA_PORT=80
|
-DOTA_PORT=80
|
||||||
-DHSV_DISABLE
|
-DHSV_DISABLE
|
||||||
-DMULTIVENT_DISABLE
|
-DMULTIVENT_DISABLE
|
||||||
|
|||||||
@@ -14,3 +14,5 @@
|
|||||||
-DPID_DISABLE
|
-DPID_DISABLE
|
||||||
#-DMCP23017
|
#-DMCP23017
|
||||||
|
|
||||||
|
-D CORS=\"*\"
|
||||||
|
-D REDIRECTION_URL=\"http://lazyhome.ru/pwa\"
|
||||||
@@ -247,9 +247,9 @@ uint16_t httpHandler(Client& client, String request, uint8_t method, long conten
|
|||||||
|
|
||||||
ArduinoOTA.sendHttpResponse(client,301,false); // Send only HTTP header, no close socket
|
ArduinoOTA.sendHttpResponse(client,301,false); // Send only HTTP header, no close socket
|
||||||
client.println(
|
client.println(
|
||||||
#ifdef CORS
|
#ifdef REDIRECTION_URL
|
||||||
//Redirect to cloud PWA application
|
//Redirect to cloud PWA application
|
||||||
String(F("Location: " CORS "/pwa"))
|
String(F("Location: " REDIRECTION_URL))
|
||||||
#else
|
#else
|
||||||
String(F("Location: /index.html"))
|
String(F("Location: /index.html"))
|
||||||
#endif
|
#endif
|
||||||
@@ -924,6 +924,7 @@ void ip_ready_config_loaded_connecting_to_broker() {
|
|||||||
|
|
||||||
if (mqttClient.connected())
|
if (mqttClient.connected())
|
||||||
{
|
{
|
||||||
|
//mqttClient.setKeepAlive(10);
|
||||||
lanStatus = RETAINING_COLLECTING;
|
lanStatus = RETAINING_COLLECTING;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user