mirror of
https://github.com/esphome/esphome.git
synced 2026-02-28 01:44:20 -07:00
[web_server] Conditionally compile authentication code to save flash memory (#10022)
This commit is contained in:
@@ -223,6 +223,7 @@ void AsyncWebServerRequest::init_response_(AsyncWebServerResponse *rsp, int code
|
||||
this->rsp_ = rsp;
|
||||
}
|
||||
|
||||
#ifdef USE_WEBSERVER_AUTH
|
||||
bool AsyncWebServerRequest::authenticate(const char *username, const char *password) const {
|
||||
if (username == nullptr || password == nullptr || *username == 0) {
|
||||
return true;
|
||||
@@ -261,6 +262,7 @@ void AsyncWebServerRequest::requestAuthentication(const char *realm) const {
|
||||
httpd_resp_set_hdr(*this, "WWW-Authenticate", auth_val.c_str());
|
||||
httpd_resp_send_err(*this, HTTPD_401_UNAUTHORIZED, nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
AsyncWebParameter *AsyncWebServerRequest::getParam(const std::string &name) {
|
||||
auto find = this->params_.find(name);
|
||||
|
||||
Reference in New Issue
Block a user