Skip to content

Commit

Permalink
fix problem calling rest / json / post with no handler defined
Browse files Browse the repository at this point in the history
  • Loading branch information
species5618 authored Nov 18, 2017
1 parent bbe3465 commit ccd373c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/FSWebServerLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,12 @@ void AsyncFSWebServer::serverInit() {
{
this->jsoncallback(request);
}
else
{
String values = "";
request->send(200, "text/plain", values);
values = "";
}
});

on("/rest", [this](AsyncWebServerRequest *request) {
Expand All @@ -1530,6 +1536,13 @@ void AsyncFSWebServer::serverInit() {
{
this->restcallback(request);
}
else
{
String values = "";
request->send(200, "text/plain", values);
values = "";
}

});

on("/post", [this](AsyncWebServerRequest *request) {
Expand All @@ -1538,6 +1551,12 @@ void AsyncFSWebServer::serverInit() {
if (postcallback)
{
this->postcallback(request);
}
else
{
String values = "";
request->send(200, "text/plain", values);
values = "";
}
});

Expand Down

0 comments on commit ccd373c

Please sign in to comment.