- Add optional Basic Auth with NVS-backed credentials and STA/AP flags; protect status, wifi, history, and download routes - Stop pre-filling WiFi/MQTT/Web UI password fields; keep stored secrets on blank and add clear-password checkboxes - Add HTML escaping + URL encoding helpers and apply to user-controlled strings; add unit test - Harden /sd/download path validation (prefix, length, dotdot, slashes) and log rejections - Enforce protocol version in LoRa receive and release GPIO14 before SD init - Update README security, SD, and GPIO sharing notes
22 lines
704 B
C++
22 lines
704 B
C++
#include <Arduino.h>
|
|
#include <unity.h>
|
|
#include "html_util.h"
|
|
|
|
static void test_html_escape_basic() {
|
|
TEST_ASSERT_EQUAL_STRING("", html_escape("").c_str());
|
|
TEST_ASSERT_EQUAL_STRING("plain", html_escape("plain").c_str());
|
|
TEST_ASSERT_EQUAL_STRING("a&b", html_escape("a&b").c_str());
|
|
TEST_ASSERT_EQUAL_STRING("<tag>", html_escape("<tag>").c_str());
|
|
TEST_ASSERT_EQUAL_STRING(""hi"", html_escape("\"hi\"").c_str());
|
|
TEST_ASSERT_EQUAL_STRING("it's", html_escape("it's").c_str());
|
|
TEST_ASSERT_EQUAL_STRING("&<>"'", html_escape("&<>\"'").c_str());
|
|
}
|
|
|
|
void setup() {
|
|
UNITY_BEGIN();
|
|
RUN_TEST(test_html_escape_basic);
|
|
UNITY_END();
|
|
}
|
|
|
|
void loop() {}
|