Skip to content

Commit 2b640c0

Browse files
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 <[email protected]>
1 parent d990ff9 commit 2b640c0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void setup(void) {
3737
Serial.println("MDNS responder started");
3838
}
3939

40-
server.on("/", []() {
40+
server.on(F("/"), []() {
4141
server.send(200, "text/plain", "hello from esp8266!");
4242
});
4343

libraries/ESP8266WebServer/src/Uri.h

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Uri {
1212
public:
1313
Uri(const char *uri) : _uri(uri) {}
1414
Uri(const String &uri) : _uri(uri) {}
15+
Uri(const __FlashStringHelper *uri) : _uri(String(uri)) {}
1516
virtual ~Uri() {}
1617

1718
virtual Uri* clone() const {

0 commit comments

Comments
 (0)