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

Commit 84236ad

Browse files
authored
v1.15.0 to fix _parseURL() bug
### Releases v1.15.0 1. Fix `_parseURL()` bug. 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 b441b56 commit 84236ad

10 files changed

+186
-152
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Arduino IDE version: 1.8.19
3737
ESP32S3_DEV board
3838
ESP32 core v2.0.6
3939
OS: Ubuntu 20.04 LTS
40-
Linux xy-Inspiron-3593 5.15.0-57-generic #63~20.04.1-Ubuntu SMP Wed Nov 30 13:40:16 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
4141
4242
Context:
4343
I encountered a crash while using this library

README.md

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

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
## Table of Contents
1818

1919
* [Changelog](#changelog)
20+
* [Releases v1.15.0](#releases-v1150)
2021
* [Releases v1.14.0](#releases-v1140)
2122
* [Releases v1.13.0](#releases-v1130)
2223
* [Releases v1.12.0](#releases-v1120)
@@ -26,6 +27,11 @@
2627

2728
## Changelog
2829

30+
### Releases v1.15.0
31+
32+
1. Fix `_parseURL()` bug. Check [Bug with _parseURL() #21](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/21)
33+
2. Improve `README.md` so that links can be used in other sites, such as `PIO`
34+
2935
### Releases v1.14.0
3036

3137
1. Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`

library.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"AsyncHTTPRequest_ESP32_Ethernet",
3-
"version": "1.14.0",
3+
"version": "1.15.0",
44
"description":"Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP library for ESP32/S2/S3/C3, WT32_ETH01 (ESP32 + LAN8720), ESP32 using LwIP ENC28J60, W5500, W6100 or LAN8720",
55
"keywords":"communication, async, tcp, http, esp32, esp32-s2, esp32-s3, esp32-c3, wt32-eth01, ethernet, w5500, w6100, enc28j60, lan8720, lwip, lwip-ethernet, lwip-enc28j60, lwip-w5500, lwip-lan8720",
66
"authors": [
@@ -51,19 +51,19 @@
5151
{
5252
"owner": "khoih-prog",
5353
"name": "WebServer_ESP32_ENC",
54-
"version": ">=1.5.1",
54+
"version": ">=1.5.3",
5555
"platforms": ["espressif32"]
5656
},
5757
{
5858
"owner": "khoih-prog",
5959
"name": "WebServer_ESP32_SC_ENC",
60-
"version": ">=1.2.0",
60+
"version": ">=1.2.1",
6161
"platforms": ["espressif32"]
6262
},
6363
{
6464
"owner": "khoih-prog",
6565
"name": "WebServer_ESP32_W5500",
66-
"version": ">=1.5.2",
66+
"version": ">=1.5.3",
6767
"platforms": ["espressif32"]
6868
},
6969
{
@@ -75,7 +75,7 @@
7575
{
7676
"owner": "khoih-prog",
7777
"name": "WebServer_ESP32_W6100",
78-
"version": ">=1.5.2",
78+
"version": ">=1.5.3",
7979
"platforms": ["espressif32"]
8080
},
8181
{

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AsyncHTTPRequest_ESP32_Ethernet
2-
version=1.14.0
2+
version=1.15.0
33
author=Bob Lemaire,Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
license=GPLv3

platformio/platformio.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ lib_deps =
4242
; AsyncTCP@>=1.1.1
4343
; ESPAsync_WiFiManager@>=1.15.1
4444
; WebServer_WT32_ETH01@>=1.5.1
45-
; WebServer_ESP32_ENC@>=1.5.1
46-
; WebServer_ESP32_SC_ENC@>=1.2.0
47-
; WebServer_ESP32_W5500@>=1.5.2
45+
; WebServer_ESP32_ENC@>=1.5.3
46+
; WebServer_ESP32_SC_ENC@>=1.2.1
47+
; WebServer_ESP32_W5500@>=1.5.3
4848
; WebServer_ESP32_SC_W5500@>=1.2.1
49-
; WebServer_ESP32_W6100@>=1.5.2
49+
; WebServer_ESP32_W6100@>=1.5.3
5050
; WebServer_ESP32_SC_W6100@>=1.2.1
5151

5252
; PlatformIO 5.x
5353
me-no-dev/AsyncTCP@>=1.1.1
5454
khoih-prog/ESPAsync_WiFiManager@>=1.15.1
5555
khoih-prog/WebServer_WT32_ETH01@>=1.5.1
56-
khoih-prog/WebServer_ESP32_ENC@>=1.5.1
57-
khoih-prog/WebServer_ESP32_SC_ENC@>=1.2.0
58-
khoih-prog/WebServer_ESP32_W5500@>=1.5.2
56+
khoih-prog/WebServer_ESP32_ENC@>=1.5.3
57+
khoih-prog/WebServer_ESP32_SC_ENC@>=1.2.1
58+
khoih-prog/WebServer_ESP32_W5500@>=1.5.3
5959
khoih-prog/WebServer_ESP32_SC_W5500@>=1.2.1
60-
khoih-prog/WebServer_ESP32_W6100@>=1.5.2
60+
khoih-prog/WebServer_ESP32_W6100@>=1.5.3
6161
khoih-prog/WebServer_ESP32_SC_W6100@>=1.2.1
6262

6363
; ============================================================

src/AsyncHTTPRequest_ESP32_Ethernet.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
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.13.0
21+
Version: 1.15.0
2222
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
2525
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2626
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
27+
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
28+
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
2729
*****************************************************************************************************************************/
2830

2931
#pragma once

src/AsyncHTTPRequest_ESP32_Ethernet.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
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.13.0
21+
Version: 1.15.0
2222
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
2525
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2626
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
27+
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
28+
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
2729
*****************************************************************************************************************************/
2830

2931
#pragma once
@@ -33,13 +35,13 @@
3335

3436
////////////////////////////////////////
3537

36-
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION "AsyncHTTPRequest_ESP32_Ethernet v1.13.0"
38+
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION "AsyncHTTPRequest_ESP32_Ethernet v1.15.0"
3739

3840
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_MAJOR 1
39-
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_MINOR 13
41+
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_MINOR 15
4042
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_PATCH 0
4143

42-
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_INT 1013000
44+
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_INT 1015000
4345

4446
////////////////////////////////////////
4547

src/AsyncHTTPRequest_ESP32_Ethernet_Debug.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
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.13.0
21+
Version: 1.15.0
2222
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
2525
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2626
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
27+
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
28+
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
2729
*****************************************************************************************************************************/
2830

2931
#pragma once

src/AsyncHTTPRequest_ESP32_Ethernet_Impl.h

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
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.13.0
21+
Version: 1.15.0
2222
2323
Version Modified By Date Comments
2424
------- ----------- ---------- -----------
2525
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
2626
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
27+
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
28+
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
2729
*****************************************************************************************************************************/
2830

2931
#pragma once
@@ -1178,11 +1180,28 @@ bool AsyncHTTPRequest::_parseURL(const String& url)
11781180

11791181
int pathBeg = url.indexOf('/', hostBeg);
11801182

1183+
int hostEnd;
1184+
int portBeg;
1185+
11811186
if (pathBeg < 0)
1182-
return false;
1187+
{
1188+
if ( url.indexOf(':', hostBeg) < 0 )
1189+
{
1190+
// No port, just https://www.aaa.com
1191+
hostEnd = url.length();
1192+
}
1193+
else
1194+
{
1195+
// with port, https://www.aaa.com:443
1196+
hostEnd = url.indexOf(':', hostBeg);
1197+
}
1198+
}
1199+
else
1200+
{
1201+
hostEnd = pathBeg;
1202+
}
11831203

1184-
int hostEnd = pathBeg;
1185-
int portBeg = url.indexOf(':', hostBeg);
1204+
portBeg = url.indexOf(':', hostBeg);
11861205

11871206
if (portBeg > 0 && portBeg < pathBeg)
11881207
{

0 commit comments

Comments
 (0)