1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 19:02:18 +01:00

[http_request] Fix for host after ArduinoJson library bump (#10348)

This commit is contained in:
Clyde Stubbs
2025-08-25 05:55:44 +10:00
committed by Jesse Hills
parent 0de7259428
commit 50408d9abb
3 changed files with 13 additions and 10 deletions

View File

@@ -1,7 +1,10 @@
#include "http_request_host.h"
#ifdef USE_HOST
#define USE_HTTP_REQUEST_HOST_H
#define CPPHTTPLIB_NO_EXCEPTIONS
#include "httplib.h"
#include "http_request_host.h"
#include <regex>
#include "esphome/components/network/util.h"
#include "esphome/components/watchdog/watchdog.h"

View File

@@ -1,11 +1,7 @@
#pragma once
#include "http_request.h"
#ifdef USE_HOST
#define CPPHTTPLIB_NO_EXCEPTIONS
#include "httplib.h"
#include "http_request.h"
namespace esphome {
namespace http_request {

View File

@@ -3,12 +3,10 @@
/**
* 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.
*/
#include "esphome/core/defines.h"
//
// httplib.h
//
@@ -17,6 +15,11 @@
//
#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
#define CPPHTTPLIB_HTTPLIB_H
@@ -9687,5 +9690,6 @@ inline SSL_CTX *Client::ssl_context() const {
#endif
#endif // CPPHTTPLIB_HTTPLIB_H
#endif // USE_HTTP_REQUEST_HOST_H
#endif