This commit is contained in:
J. Nick Koston 2025-06-29 20:18:32 -05:00
parent d065f4ae62
commit f26bec1a5a
No known key found for this signature in database
3 changed files with 1 additions and 13 deletions

View File

@ -37,15 +37,6 @@ const char *stristr(const char *haystack, const char *needle) {
return nullptr;
}
// Check if content type is form-urlencoded (case-insensitive)
bool is_form_urlencoded(const char *content_type) {
if (!content_type) {
return false;
}
return stristr(content_type, "application/x-www-form-urlencoded") != nullptr;
}
} // namespace web_server_idf
} // namespace esphome
#endif // USE_ESP_IDF

View File

@ -16,9 +16,6 @@ bool str_ncmp_ci(const char *s1, const char *s2, size_t n);
// Case-insensitive string search (like strstr but case-insensitive)
const char *stristr(const char *haystack, const char *needle);
// Check if content type is form-urlencoded (case-insensitive)
bool is_form_urlencoded(const char *content_type);
} // namespace web_server_idf
} // namespace esphome
#endif // USE_ESP_IDF

View File

@ -97,7 +97,7 @@ esp_err_t AsyncWebServer::request_post_handler(httpd_req_t *r) {
const char *content_type_char = content_type.value().c_str();
// Check most common case first
if (is_form_urlencoded(content_type_char)) {
if (stristr(content_type_char, "application/x-www-form-urlencoded") != nullptr) {
// Normal form data - proceed with regular handling
#ifdef USE_WEBSERVER_OTA
} else if (stristr(content_type_char, "multipart/form-data") != nullptr) {