Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 3880396

Browse files
authored
v1.5.0 to fix _parseURL() bug
### Releases v1.5.0 1. Fix bug of `_parseURL()`. Check [Bug with _parseURL() #21](khoih-prog/AsyncHTTPSRequest_Generic#21) 2. Improve `README.md` so that links can be used in other sites, such as `PIO`
1 parent a77ac48 commit 3880396

9 files changed

+128
-94
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ However, before reporting a bug please check through the following:
1010

1111
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest/issues/new).
1212

13+
---
14+
1315
### How to submit a bug report
1416

1517
Please ensure to specify the following:
1618

1719
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18-
* `ArduinoCore-mbed` Core Version (e.g. `ArduinoCore-mbed` mbed_portenta core v3.4.1)
20+
* `ArduinoCore-mbed` Core Version (e.g. `ArduinoCore-mbed` mbed_portenta core v3.5.4)
1921
* `Portenta_H7` Board type (e.g. Portenta_H7 Rev2 ABX00042, etc.)
2022
* Contextual information (e.g. what you were trying to achieve)
2123
* Simplest possible steps to reproduce
@@ -24,14 +26,18 @@ Please ensure to specify the following:
2426
* Network configuration
2527

2628

29+
Please be educated, civilized and constructive as you've always been. Disrespective posts against [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-event-code-of-conduct) will be ignored and deleted.
30+
31+
---
32+
2733
### Example
2834

2935
```
3036
Arduino IDE version: 1.8.19
31-
`ArduinoCore-mbed` mbed_portenta core v3.4.1
37+
`ArduinoCore-mbed` mbed_portenta core v3.5.4
3238
Portenta_H7 Rev2 ABX00042
3339
OS: Ubuntu 20.04 LTS
34-
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
40+
Linux xy-Inspiron-3593 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
3541
3642
Context:
3743
I encountered a crash while using this library

README.md

Lines changed: 77 additions & 77 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
1010
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
1111

12+
1213
---
1314
---
1415

1516
## Table of Contents
1617

1718
* [Changelog](#changelog)
19+
* [Releases v1.5.0](#releases-v150)
1820
* [Releases v1.4.2](#releases-v142)
1921
* [Releases v1.4.1](#releases-v141)
2022
* [Releases v1.4.0](#releases-v140)
@@ -29,6 +31,11 @@
2931

3032
## Changelog
3133

34+
### Releases v1.5.0
35+
36+
1. Fix bug of `_parseURL()`. Check [Bug with _parseURL() #21](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/21)
37+
2. Improve `README.md` so that links can be used in other sites, such as `PIO`
38+
3239
### Releases v1.4.2
3340

3441
1. Default to reconnect to the same `host:port` after connected for new HTTP sites. Check [Host/Headers not always sent with 1.10.1 #44](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/44)

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Portenta_H7_AsyncHTTPRequest",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"keywords": "communication, http, async, websocket, webserver, async-webserver, async-tcp, async-udp, async-websocket, async-http, ssl, tls, mbed, mbed-portenta, portenta-h7, portentah7, portenta-h7-m7, portenta-h7-m4, portentah7-m7, portentah7-m4, stm32h7",
55
"description": "Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of Portenta_H7_AsyncTCP library for Portenta_7, using Vision-shield Ethernet or Murata WiFi.",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Portenta_H7_AsyncHTTPRequest
2-
version=1.4.2
2+
version=1.5.0
33
author=Bob Lemaire,Khoi Hoang
44
maintainer=Khoi Hoang <[email protected]>
55
sentence=Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of Portenta_H7_AsyncTCP library for Portenta_7, using Vision-shield thernet or Murata WiFi.

src/Portenta_H7_AsyncHTTPRequest.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
You should have received a copy of the GNU General Public License along with this program.
1919
If not, see <https://www.gnu.org/licenses/>.
2020
21-
Version: 1.4.2
21+
Version: 1.5.0
2222
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.4.0 K Hoang 20/10/2022 Fix bug. Clean up
3131
1.4.1 K Hoang 22/10/2022 Fix bug of wrong reqStates
3232
1.4.2 K Hoang 10/11/2022 Default to reconnect to the same host:port after connected for new HTTP sites
33+
1.5.0 K Hoang 01/02/2023 Fix _parseURL() bug
3334
*****************************************************************************************************************************/
3435

3536
#pragma once

src/Portenta_H7_AsyncHTTPRequest.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
You should have received a copy of the GNU General Public License along with this program.
1919
If not, see <https://www.gnu.org/licenses/>.
2020
21-
Version: 1.4.2
22-
21+
Version: 1.5.0
22+
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
2525
1.0.0 K Hoang 13/10/2020 Initial coding for Portenta_H7
@@ -30,6 +30,7 @@
3030
1.4.0 K Hoang 20/10/2022 Fix bug. Clean up
3131
1.4.1 K Hoang 22/10/2022 Fix bug of wrong reqStates
3232
1.4.2 K Hoang 10/11/2022 Default to reconnect to the same host:port after connected for new HTTP sites
33+
1.5.0 K Hoang 01/02/2023 Fix _parseURL() bug
3334
*****************************************************************************************************************************/
3435

3536
#pragma once
@@ -70,13 +71,13 @@
7071

7172
////////////////////////////////////////
7273

73-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION "Portenta_H7_AsyncHTTPRequest v1.4.2"
74+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION "Portenta_H7_AsyncHTTPRequest v1.5.0"
7475

7576
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MAJOR 1
76-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MINOR 4
77-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_PATCH 2
77+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MINOR 5
78+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_PATCH 0
7879

79-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_INT 1004002
80+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_INT 1005000
8081

8182
////////////////////////////////////////
8283

src/Portenta_H7_AsyncHTTPRequest_Debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
You should have received a copy of the GNU General Public License along with this program.
1919
If not, see <https://www.gnu.org/licenses/>.
2020
21-
Version: 1.4.2
21+
Version: 1.5.0
2222
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.4.0 K Hoang 20/10/2022 Fix bug. Clean up
3131
1.4.1 K Hoang 22/10/2022 Fix bug of wrong reqStates
3232
1.4.2 K Hoang 10/11/2022 Default to reconnect to the same host:port after connected for new HTTP sites
33+
1.5.0 K Hoang 01/02/2023 Fix _parseURL() bug
3334
*****************************************************************************************************************************/
3435

3536
#pragma once

src/Portenta_H7_AsyncHTTPRequest_Impl.h

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
You should have received a copy of the GNU General Public License along with this program.
1919
If not, see <https://www.gnu.org/licenses/>.
2020
21-
Version: 1.4.2
21+
Version: 1.5.0
2222
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.4.0 K Hoang 20/10/2022 Fix bug. Clean up
3131
1.4.1 K Hoang 22/10/2022 Fix bug of wrong reqStates
3232
1.4.2 K Hoang 10/11/2022 Default to reconnect to the same host:port after connected for new HTTP sites
33+
1.5.0 K Hoang 01/02/2023 Fix _parseURL() bug
3334
*****************************************************************************************************************************/
3435

3536
#pragma once
@@ -1172,11 +1173,28 @@ bool AsyncHTTPRequest::_parseURL(const String& url)
11721173

11731174
int pathBeg = url.indexOf('/', hostBeg);
11741175

1176+
int hostEnd;
1177+
int portBeg;
1178+
11751179
if (pathBeg < 0)
1176-
return false;
1180+
{
1181+
if ( url.indexOf(':', hostBeg) < 0 )
1182+
{
1183+
// No port, just https://www.aaa.com
1184+
hostEnd = url.length();
1185+
}
1186+
else
1187+
{
1188+
// with port, https://www.aaa.com:80
1189+
hostEnd = url.indexOf(':', hostBeg);
1190+
}
1191+
}
1192+
else
1193+
{
1194+
hostEnd = pathBeg;
1195+
}
11771196

1178-
int hostEnd = pathBeg;
1179-
int portBeg = url.indexOf(':', hostBeg);
1197+
portBeg = url.indexOf(':', hostBeg);
11801198

11811199
if (portBeg > 0 && portBeg < pathBeg)
11821200
{

0 commit comments

Comments
 (0)