mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-24 09:07:05 +01:00
- provide 'prepend' option for ws callbacks, in addition to current 'append' - move unintentional adminpass check under normal callbacks, do not break the on_keychecks iteration when adminpass key is present - move key checks to their respective modules; reference existing key objects
39 lines
820 B
C++
39 lines
820 B
C++
/*
|
|
|
|
WEBSERVER MODULE
|
|
|
|
Copyright (C) 2016-2019 by Xose Pérez <xose dot perez at gmail dot com>
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "espurna.h"
|
|
|
|
#include <ESPAsyncWebServer.h>
|
|
|
|
#include <functional>
|
|
#include <list>
|
|
#include <vector>
|
|
|
|
#include "web_utils.h"
|
|
#include "web_print.h"
|
|
|
|
using web_body_callback_f = std::function<bool(AsyncWebServerRequest*, uint8_t* data, size_t len, size_t index, size_t total)>;
|
|
using web_request_callback_f = std::function<bool(AsyncWebServerRequest*)>;
|
|
|
|
void webSecurityHeaders(AsyncWebServerResponse*);
|
|
|
|
uint16_t webPort();
|
|
AsyncWebServer& webServer();
|
|
|
|
bool webApModeRequest(AsyncWebServerRequest*);
|
|
|
|
bool webAuthenticate(AsyncWebServerRequest*);
|
|
void webLog(AsyncWebServerRequest*);
|
|
|
|
void webBodyRegister(web_body_callback_f);
|
|
void webRequestRegister(web_request_callback_f);
|
|
|
|
void webSetup();
|