mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	[http_request] Fix for host after ArduinoJson library bump (#10348)
This commit is contained in:
		| @@ -1,7 +1,10 @@ | |||||||
| #include "http_request_host.h" |  | ||||||
|  |  | ||||||
| #ifdef USE_HOST | #ifdef USE_HOST | ||||||
|  |  | ||||||
|  | #define USE_HTTP_REQUEST_HOST_H | ||||||
|  | #define CPPHTTPLIB_NO_EXCEPTIONS | ||||||
|  | #include "httplib.h" | ||||||
|  | #include "http_request_host.h" | ||||||
|  |  | ||||||
| #include <regex> | #include <regex> | ||||||
| #include "esphome/components/network/util.h" | #include "esphome/components/network/util.h" | ||||||
| #include "esphome/components/watchdog/watchdog.h" | #include "esphome/components/watchdog/watchdog.h" | ||||||
|   | |||||||
| @@ -1,11 +1,7 @@ | |||||||
| #pragma once | #pragma once | ||||||
|  |  | ||||||
| #include "http_request.h" |  | ||||||
|  |  | ||||||
| #ifdef USE_HOST | #ifdef USE_HOST | ||||||
|  | #include "http_request.h" | ||||||
| #define CPPHTTPLIB_NO_EXCEPTIONS |  | ||||||
| #include "httplib.h" |  | ||||||
| namespace esphome { | namespace esphome { | ||||||
| namespace http_request { | namespace http_request { | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,12 +3,10 @@ | |||||||
| /** | /** | ||||||
|  * NOTE: This is a copy of httplib.h from https://github.com/yhirose/cpp-httplib |  * NOTE: This is a copy of httplib.h from https://github.com/yhirose/cpp-httplib | ||||||
|  * |  * | ||||||
|  * It has been modified only to add ifdefs for USE_HOST. While it contains many functions unused in ESPHome, |  * It has been modified to add ifdefs for USE_HOST. While it contains many functions unused in ESPHome, | ||||||
|  * it was considered preferable to use it with as few changes as possible, to facilitate future updates. |  * it was considered preferable to use it with as few changes as possible, to facilitate future updates. | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #include "esphome/core/defines.h" |  | ||||||
|  |  | ||||||
| // | // | ||||||
| //  httplib.h | //  httplib.h | ||||||
| // | // | ||||||
| @@ -17,6 +15,11 @@ | |||||||
| // | // | ||||||
|  |  | ||||||
| #ifdef USE_HOST | #ifdef USE_HOST | ||||||
|  | // Prevent this code being included in main.cpp | ||||||
|  | #ifdef USE_HTTP_REQUEST_HOST_H | ||||||
|  |  | ||||||
|  | #include "esphome/core/defines.h" | ||||||
|  |  | ||||||
| #ifndef CPPHTTPLIB_HTTPLIB_H | #ifndef CPPHTTPLIB_HTTPLIB_H | ||||||
| #define CPPHTTPLIB_HTTPLIB_H | #define CPPHTTPLIB_HTTPLIB_H | ||||||
|  |  | ||||||
| @@ -9687,5 +9690,6 @@ inline SSL_CTX *Client::ssl_context() const { | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #endif  // CPPHTTPLIB_HTTPLIB_H | #endif  // CPPHTTPLIB_HTTPLIB_H | ||||||
|  | #endif  // USE_HTTP_REQUEST_HOST_H | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user