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

Commit

Permalink
v1.15.0 to fix _parseURL() bug
Browse files Browse the repository at this point in the history
### 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`
  • Loading branch information
khoih-prog authored Feb 1, 2023
1 parent b441b56 commit 84236ad
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 152 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Arduino IDE version: 1.8.19
ESP32S3_DEV board
ESP32 core v2.0.6
OS: Ubuntu 20.04 LTS
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
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
Context:
I encountered a crash while using this library
Expand Down
257 changes: 130 additions & 127 deletions README.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.15.0](#releases-v1150)
* [Releases v1.14.0](#releases-v1140)
* [Releases v1.13.0](#releases-v1130)
* [Releases v1.12.0](#releases-v1120)
Expand All @@ -26,6 +27,11 @@

## Changelog

### Releases v1.15.0

1. Fix `_parseURL()` bug. Check [Bug with _parseURL() #21](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/21)
2. Improve `README.md` so that links can be used in other sites, such as `PIO`

### Releases v1.14.0

1. Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
Expand Down
10 changes: 5 additions & 5 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"AsyncHTTPRequest_ESP32_Ethernet",
"version": "1.14.0",
"version": "1.15.0",
"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",
"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",
"authors": [
Expand Down Expand Up @@ -51,19 +51,19 @@
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_ENC",
"version": ">=1.5.1",
"version": ">=1.5.3",
"platforms": ["espressif32"]
},
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_SC_ENC",
"version": ">=1.2.0",
"version": ">=1.2.1",
"platforms": ["espressif32"]
},
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_W5500",
"version": ">=1.5.2",
"version": ">=1.5.3",
"platforms": ["espressif32"]
},
{
Expand All @@ -75,7 +75,7 @@
{
"owner": "khoih-prog",
"name": "WebServer_ESP32_W6100",
"version": ">=1.5.2",
"version": ">=1.5.3",
"platforms": ["espressif32"]
},
{
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=AsyncHTTPRequest_ESP32_Ethernet
version=1.14.0
version=1.15.0
author=Bob Lemaire,Khoi Hoang <khoih.prog@gmail.com>
maintainer=Khoi Hoang <khoih.prog@gmail.com>
license=GPLv3
Expand Down
16 changes: 8 additions & 8 deletions platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ lib_deps =
; AsyncTCP@>=1.1.1
; ESPAsync_WiFiManager@>=1.15.1
; WebServer_WT32_ETH01@>=1.5.1
; WebServer_ESP32_ENC@>=1.5.1
; WebServer_ESP32_SC_ENC@>=1.2.0
; WebServer_ESP32_W5500@>=1.5.2
; WebServer_ESP32_ENC@>=1.5.3
; WebServer_ESP32_SC_ENC@>=1.2.1
; WebServer_ESP32_W5500@>=1.5.3
; WebServer_ESP32_SC_W5500@>=1.2.1
; WebServer_ESP32_W6100@>=1.5.2
; WebServer_ESP32_W6100@>=1.5.3
; WebServer_ESP32_SC_W6100@>=1.2.1

; PlatformIO 5.x
me-no-dev/AsyncTCP@>=1.1.1
khoih-prog/ESPAsync_WiFiManager@>=1.15.1
khoih-prog/WebServer_WT32_ETH01@>=1.5.1
khoih-prog/WebServer_ESP32_ENC@>=1.5.1
khoih-prog/WebServer_ESP32_SC_ENC@>=1.2.0
khoih-prog/WebServer_ESP32_W5500@>=1.5.2
khoih-prog/WebServer_ESP32_ENC@>=1.5.3
khoih-prog/WebServer_ESP32_SC_ENC@>=1.2.1
khoih-prog/WebServer_ESP32_W5500@>=1.5.3
khoih-prog/WebServer_ESP32_SC_W5500@>=1.2.1
khoih-prog/WebServer_ESP32_W6100@>=1.5.2
khoih-prog/WebServer_ESP32_W6100@>=1.5.3
khoih-prog/WebServer_ESP32_SC_W6100@>=1.2.1

; ============================================================
Expand Down
4 changes: 3 additions & 1 deletion src/AsyncHTTPRequest_ESP32_Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
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.13.0
Version: 1.15.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
*****************************************************************************************************************************/

#pragma once
Expand Down
10 changes: 6 additions & 4 deletions src/AsyncHTTPRequest_ESP32_Ethernet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
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.13.0
Version: 1.15.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
*****************************************************************************************************************************/

#pragma once
Expand All @@ -33,13 +35,13 @@

////////////////////////////////////////

#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION "AsyncHTTPRequest_ESP32_Ethernet v1.13.0"
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION "AsyncHTTPRequest_ESP32_Ethernet v1.15.0"

#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_MAJOR 1
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_MINOR 13
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_MINOR 15
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_PATCH 0

#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_INT 1013000
#define ASYNC_HTTP_REQUEST_ESP32_ETHERNET_VERSION_INT 1015000

////////////////////////////////////////

Expand Down
4 changes: 3 additions & 1 deletion src/AsyncHTTPRequest_ESP32_Ethernet_Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
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.13.0
Version: 1.15.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
*****************************************************************************************************************************/

#pragma once
Expand Down
27 changes: 23 additions & 4 deletions src/AsyncHTTPRequest_ESP32_Ethernet_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
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.13.0
Version: 1.15.0
Version Modified By Date Comments
------- ----------- ---------- -----------
1.12.0 K Hoang 16/12/2022 Initial coding to port to ESP32S3 boards using LwIP W5500 or ENC28J60 Ethernet
1.13.0 K Hoang 21/12/2022 Add support to ESP32S2/C3 boards using LwIP W5500 or ENC28J60 Ethernet
1.14.0 K Hoang 09/01/2023 Add support to `ESP32` and `ESP32S2/S3/C3` boards using `LwIP W6100 Ethernet`
1.15.0 K Hoang 01/02/2023 Fix _parseURL() bug
*****************************************************************************************************************************/

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

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

int hostEnd;
int portBeg;

if (pathBeg < 0)
return false;
{
if ( url.indexOf(':', hostBeg) < 0 )
{
// No port, just https://www.aaa.com
hostEnd = url.length();
}
else
{
// with port, https://www.aaa.com:443
hostEnd = url.indexOf(':', hostBeg);
}
}
else
{
hostEnd = pathBeg;
}

int hostEnd = pathBeg;
int portBeg = url.indexOf(':', hostBeg);
portBeg = url.indexOf(':', hostBeg);

if (portBeg > 0 && portBeg < pathBeg)
{
Expand Down

0 comments on commit 84236ad

Please sign in to comment.