mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-07 16:57:05 +01:00
api: allow to use path helper without api enabled
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
|
||||
API MODULE
|
||||
API & WEB API MODULE
|
||||
|
||||
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
|
||||
Copyright (C) 2020-2021 by Maxim Prokhorov <prokhorov dot max at outlook dot com>
|
||||
|
||||
*/
|
||||
|
||||
@@ -10,16 +11,17 @@ Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#if API_SUPPORT
|
||||
|
||||
#include "system.h"
|
||||
#include "web.h"
|
||||
#include "rpc.h"
|
||||
|
||||
#if WEB_SUPPORT
|
||||
#include "web.h"
|
||||
#include <ESPAsyncTCP.h>
|
||||
#include <ArduinoJson.h>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <cstring>
|
||||
#include <forward_list>
|
||||
#include <vector>
|
||||
@@ -230,6 +232,8 @@ size_t ApiRequest::wildcards() const {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#if API_SUPPORT
|
||||
|
||||
bool _apiAccepts(AsyncWebServerRequest* request, const __FlashStringHelper* str) {
|
||||
auto* header = request->getHeader(F("Accept"));
|
||||
if (header) {
|
||||
|
||||
Reference in New Issue
Block a user