[web_server_idf] Skip multipart parser sources when OTA upload is disabled

This commit is contained in:
J. Nick Koston
2026-08-19 21:24:45 -05:00
parent 29404a782c
commit 6ead411bb0
@@ -1,5 +1,6 @@
from esphome.components.esp32 import add_idf_sdkconfig_option
import esphome.config_validation as cv
from esphome.core import CORE
CODEOWNERS = ["@dentra"]
@@ -12,3 +13,11 @@ CONFIG_SCHEMA = cv.All(
async def to_code(config):
# Increase the maximum supported size of headers section in HTTP request packet to be processed by the server
add_idf_sdkconfig_option("CONFIG_HTTPD_MAX_REQ_HDR_LEN", 1024)
def FILTER_SOURCE_FILES() -> list[str]:
# multipart.cpp is fully #ifdef'd on USE_WEBSERVER_OTA (set by the
# web_server OTA platform); skip it when OTA uploads are not configured.
if not any(define.name == "USE_WEBSERVER_OTA" for define in CORE.defines):
return ["multipart.cpp"]
return []