mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	preen
This commit is contained in:
		| @@ -37,15 +37,6 @@ const char *stristr(const char *haystack, const char *needle) { | |||||||
|   return nullptr; |   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 web_server_idf | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
| #endif  // USE_ESP_IDF | #endif  // USE_ESP_IDF | ||||||
|   | |||||||
| @@ -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) | // Case-insensitive string search (like strstr but case-insensitive) | ||||||
| const char *stristr(const char *haystack, const char *needle); | 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 web_server_idf | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
| #endif  // USE_ESP_IDF | #endif  // USE_ESP_IDF | ||||||
|   | |||||||
| @@ -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(); |     const char *content_type_char = content_type.value().c_str(); | ||||||
|  |  | ||||||
|     // Check most common case first |     // 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 |       // Normal form data - proceed with regular handling | ||||||
| #ifdef USE_WEBSERVER_OTA | #ifdef USE_WEBSERVER_OTA | ||||||
|     } else if (stristr(content_type_char, "multipart/form-data") != nullptr) { |     } else if (stristr(content_type_char, "multipart/form-data") != nullptr) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user