1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-09 09:11:52 +00:00

Compare commits

...

1 Commits

Author SHA1 Message Date
J. Nick Koston
9299d83eeb Remove unused host() method from AsyncWebServerRequest
Dead code with no callers. Also avoids an unchecked .value() on
optional<string> that would crash on HTTP/1.0 requests without
a Host header.
2026-02-08 08:23:27 -06:00
2 changed files with 0 additions and 3 deletions

View File

@@ -258,8 +258,6 @@ StringRef AsyncWebServerRequest::url_to(std::span<char, URL_BUF_SIZE> buffer) co
return StringRef(buffer.data(), decoded_len);
}
std::string AsyncWebServerRequest::host() const { return this->get_header("Host").value(); }
void AsyncWebServerRequest::send(AsyncWebServerResponse *response) {
httpd_resp_send(*this, response->get_content_data(), response->get_content_size());
}

View File

@@ -121,7 +121,6 @@ class AsyncWebServerRequest {
char buffer[URL_BUF_SIZE];
return std::string(this->url_to(buffer));
}
std::string host() const;
// NOLINTNEXTLINE(readability-identifier-naming)
size_t contentLength() const { return this->req_->content_len; }