1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

Add flash helper constructor to Uri (#7105)

* Update Uri.h

* Add a simple test for the new constructor

Convert a c-str to a FPSTR in the example to have a section
of code in our CI that will catch any future breaks of this specific
kind.

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
This commit is contained in:
Develo 2020-02-23 16:29:47 -03:00 committed by GitHub
parent d990ff9547
commit 2b640c0189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,7 @@ void setup(void) {
Serial.println("MDNS responder started");
}
server.on("/", []() {
server.on(F("/"), []() {
server.send(200, "text/plain", "hello from esp8266!");
});

View File

@ -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 {