From ae240a39026d62f3e324eded8c0a1f323fee8648 Mon Sep 17 00:00:00 2001 From: Bob Mooij Date: Mon, 19 Oct 2020 16:20:49 +0200 Subject: [PATCH] Add flash helper constructor to Uri --- libraries/WebServer/examples/PathArgServer/PathArgServer.ino | 2 +- libraries/WebServer/src/Uri.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/WebServer/examples/PathArgServer/PathArgServer.ino index 6e120c3f..0b4dc425 100644 --- a/libraries/WebServer/examples/PathArgServer/PathArgServer.ino +++ b/libraries/WebServer/examples/PathArgServer/PathArgServer.ino @@ -32,7 +32,7 @@ void setup(void) { Serial.println("MDNS responder started"); } - server.on("/", []() { + server.on(F("/"), []() { server.send(200, "text/plain", "hello from esp32!"); }); diff --git a/libraries/WebServer/src/Uri.h b/libraries/WebServer/src/Uri.h index 83772b23..d924a0bd 100644 --- a/libraries/WebServer/src/Uri.h +++ b/libraries/WebServer/src/Uri.h @@ -12,6 +12,7 @@ class Uri { public: Uri(const char *uri) : _uri(uri) {} Uri(const String &uri) : _uri(uri) {} + Uri(const __FlashStringHelper *uri) : _uri(String(uri)) {} virtual ~Uri() {} virtual Uri* clone() const {