### Releases v1.1.1

1. Prevent crash if request and/or method not correct.
This commit is contained in:
Khoi Hoang
2020-12-23 23:35:07 -05:00
committed by GitHub
parent c11a245270
commit 233dbbbbcd
26 changed files with 432 additions and 86 deletions

View File

@@ -17,7 +17,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Version: 1.1.0
Version: 1.1.1
Version Modified By Date Comments
------- ----------- ---------- -----------
@@ -25,6 +25,7 @@
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
1.1.0 K Hoang 23/12/2020 Add HTTP PUT, PATCH, DELETE and HEAD methods
1.1.1 K Hoang 24/12/2020 Prevent crash if request and/or method not correct.
*****************************************************************************************************************************/
//************************************************************************************************************
//
@@ -103,11 +104,22 @@ void heartBeatPrint(void)
void sendRequest()
{
static bool requestOpenResult;
if (request.readyState() == readyStateUnsent || request.readyState() == readyStateDone)
{
//request.open("GET", "http://worldtimeapi.org/api/timezone/Europe/London.txt");
request.open("GET", "http://worldtimeapi.org/api/timezone/America/Toronto.txt");
request.send();
//requestOpenResult = request.open("GET", "http://worldtimeapi.org/api/timezone/Europe/London.txt");
requestOpenResult = request.open("GET", "http://worldtimeapi.org/api/timezone/America/Toronto.txt");
if (requestOpenResult)
{
// Only send() if open() returns true, or crash
request.send();
}
else
{
Serial.println("Can't send bad request");
}
}
else
{