Merge pull request from GHSA-48mj-p7x2-5jfm

This commit is contained in:
Otto Winter
2021-09-28 02:53:38 +02:00
committed by Jesse Hills
parent 1853407645
commit 4579f78bf9
5 changed files with 84 additions and 28 deletions
+3 -10
View File
@@ -1,8 +1,8 @@
#include "web_server.h"
#include "esphome/core/log.h"
#include "esphome/core/application.h"
#include "esphome/core/util.h"
#include "esphome/components/json/json_util.h"
#include "esphome/core/application.h"
#include "esphome/core/log.h"
#include "esphome/core/util.h"
#include "StreamString.h"
@@ -151,9 +151,6 @@ void WebServer::setup() {
void WebServer::dump_config() {
ESP_LOGCONFIG(TAG, "Web Server:");
ESP_LOGCONFIG(TAG, " Address: %s:%u", network_get_address().c_str(), this->base_->get_port());
if (this->using_auth()) {
ESP_LOGCONFIG(TAG, " Basic authentication enabled");
}
}
float WebServer::get_setup_priority() const { return setup_priority::WIFI - 1.0f; }
@@ -728,10 +725,6 @@ bool WebServer::canHandle(AsyncWebServerRequest *request) {
return false;
}
void WebServer::handleRequest(AsyncWebServerRequest *request) {
if (this->using_auth() && !request->authenticate(this->username_, this->password_)) {
return request->requestAuthentication();
}
if (request->url() == "/") {
this->handle_index_request(request);
return;