Skip to content

Commit

Permalink
(2.3.2) Fixed content type workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Jan 6, 2019
1 parent 4398ea1 commit fdee318
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Espalexa
version=2.3.1
version=2.3.2
author=Christian Schwinne
maintainer=Christian Schwinne
sentence=Library to control an ESP module with the Alexa voice assistant
Expand Down
9 changes: 4 additions & 5 deletions src/Espalexa.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
/*
* @title Espalexa library
* @version 2.3.1
* @version 2.3.2
* @author Christian Schwinne
* @license MIT
* @contributors d-999
Expand Down Expand Up @@ -46,7 +46,7 @@
#include <WiFiUdp.h>

#ifdef ESPALEXA_DEBUG
#pragma message "Espalexa 2.3.0 debug mode"
#pragma message "Espalexa 2.3.2 debug mode"
#define EA_DEBUG(x) Serial.print (x)
#define EA_DEBUGLN(x) Serial.println (x)
#else
Expand Down Expand Up @@ -112,7 +112,7 @@ class Espalexa {
}
res += "\r\nFree Heap: " + (String)ESP.getFreeHeap();
res += "\r\nUptime: " + (String)millis();
res += "\r\n\r\nEspalexa library v2.3.0 by Christian Schwinne 2019";
res += "\r\n\r\nEspalexa library v2.3.2 by Christian Schwinne 2019";
server->send(200, "text/plain", res);
}

Expand Down Expand Up @@ -391,10 +391,9 @@ class Espalexa {
{
server = request; //copy request reference
String req = request->url(); //body from global variable
if (body.length() == 0) //if first body method didn't work, try other
if (request->hasParam("body", true)) // workaround should Alexa send incorrect content type
{
EA_DEBUG("BodyMethod2");
if (request->hasParam("body", true)) // This is necessary, otherwise ESP crashes if there is no body
body = request->getParam("body", true)->value();
}
EA_DEBUG("FinalBody: ");
Expand Down

0 comments on commit fdee318

Please sign in to comment.