Skip to content

Commit

Permalink
Add flash helper constructor to Uri (#7105)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
devyte and earlephilhower committed Feb 23, 2020
1 parent d990ff9 commit 2b640c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
});

Expand Down
1 change: 1 addition & 0 deletions libraries/ESP8266WebServer/src/Uri.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2b640c0

Please sign in to comment.