Revert "Added AC_ONBOOTURI_PORTAL option"

This reverts commit 2eab4c78ce.
pull/197/head
Hieromon Ikasamo 4 years ago
parent 2eab4c78ce
commit 6faad9eec6
  1. 11
      src/AutoConnect.cpp
  2. 5
      src/AutoConnect.h

@ -311,13 +311,8 @@ bool AutoConnect::_configSTA(const IPAddress& ip, const IPAddress& gateway, cons
return rc;
}
/**
* Get URI to redirect at boot. It uses the URI according to the
* AutoConnectConfig::bootUti setting with the AutoConnectConfig::homeUri
* as the boot path.
* @return the boot uri.
*/
String AutoConnect::_getBootUri(void) const {
String AutoConnect::_getBootUri()
{
if (_apConfig.bootUri == AC_ONBOOTURI_ROOT)
return String(AUTOCONNECT_URI);
else if (_apConfig.bootUri == AC_ONBOOTURI_HOME)
@ -690,7 +685,7 @@ bool AutoConnect::_captivePortal(void) {
String hostHeader = _webServer->hostHeader();
if (!_isIP(hostHeader) && (hostHeader != WiFi.localIP().toString()) && (!hostHeader.endsWith(F(".local")))) {
AC_DBG("Detected application, %s, %s\n", hostHeader.c_str(), WiFi.localIP().toString().c_str());
String location = String(F("http://")) + _webServer->client().localIP().toString() + (_apConfig.bootUri == AC_ONBOOTURI_PORTAL ? _getBootUri() : String(AUTOCONNECT_URI));
String location = String(F("http://")) + _webServer->client().localIP().toString() + _getBootUri();
_webServer->sendHeader(String(F("Location")), location, true);
_webServer->send(302, String(F("text/plain")), _emptyString);
_webServer->client().flush();

@ -47,8 +47,7 @@ typedef enum AC_SAVECREDENTIAL {
typedef enum AC_ONBOOTURI {
AC_ONBOOTURI_ROOT,
AC_ONBOOTURI_HOME,
AC_ONBOOTURI_PORTAL
AC_ONBOOTURI_HOME
} AC_ONBOOTURI_t;
class AutoConnectConfig {
@ -225,7 +224,7 @@ class AutoConnect {
} AC_STARECONNECT_t;
bool _config(void);
bool _configSTA(const IPAddress& ip, const IPAddress& gateway, const IPAddress& netmask, const IPAddress& dns1, const IPAddress& dns2);
String _getBootUri(void) const;
String _getBootUri();
bool _getConfigSTA(station_config_t* config);
void _startWebServer(void);
void _startDNSServer(void);

Loading…
Cancel
Save