Permalink
Browse files

🐛 Add CORS for /wifi/connect (#274)

1 parent 26dafb8 commit 7dc2dd52ec56bdf7bc1de7868fa86c23850c6a4f @keyeh keyeh committed with Jan 3, 2017
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/Homie/Boot/BootConfig.cpp
@@ -60,6 +60,10 @@ void BootConfig::setup() {
_http.sendContent(FPSTR(PROGMEM_CONFIG_CORS));
});
_http.on("/wifi/connect", HTTP_PUT, std::bind(&BootConfig::_onWifiConnectRequest, this));
+ _http.on("/wifi/connect", HTTP_OPTIONS, [this]() { // CORS
+ Interface::get().getLogger() << F("Received CORS request for /wifi/connect") << endl;
+ _http.sendContent(FPSTR(PROGMEM_CONFIG_CORS));
+ });
_http.on("/wifi/status", HTTP_GET, std::bind(&BootConfig::_onWifiStatusRequest, this));
_http.on("/proxy/control", HTTP_PUT, std::bind(&BootConfig::_onProxyControlRequest, this));
_http.onNotFound(std::bind(&BootConfig::_onCaptivePortal, this));

0 comments on commit 7dc2dd5

Please sign in to comment.