Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
704b71da
Unverified
Commit
704b71da
authored
Nov 02, 2020
by
Me No Dev
Committed by
GitHub
Nov 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix header parsing
fixes #4454 closes #4455
parent
7c057217
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
libraries/HTTPClient/src/HTTPClient.cpp
libraries/HTTPClient/src/HTTPClient.cpp
+6
-4
No files found.
libraries/HTTPClient/src/HTTPClient.cpp
View file @
704b71da
...
@@ -1186,6 +1186,7 @@ int HTTPClient::handleHeaderResponse()
...
@@ -1186,6 +1186,7 @@ int HTTPClient::handleHeaderResponse()
_transferEncoding
=
HTTPC_TE_IDENTITY
;
_transferEncoding
=
HTTPC_TE_IDENTITY
;
unsigned
long
lastDataTime
=
millis
();
unsigned
long
lastDataTime
=
millis
();
bool
firstLine
=
true
;
while
(
connected
())
{
while
(
connected
())
{
size_t
len
=
_client
->
available
();
size_t
len
=
_client
->
available
();
...
@@ -1197,11 +1198,12 @@ int HTTPClient::handleHeaderResponse()
...
@@ -1197,11 +1198,12 @@ int HTTPClient::handleHeaderResponse()
log_v
(
"RX: '%s'"
,
headerLine
.
c_str
());
log_v
(
"RX: '%s'"
,
headerLine
.
c_str
());
if
(
headerLine
.
startsWith
(
"HTTP/1."
)
)
{
if
(
firstLine
)
{
if
(
_canReuse
)
{
if
(
_canReuse
&&
headerLine
.
startsWith
(
"HTTP/1."
)
)
{
_canReuse
=
(
headerLine
[
sizeof
"HTTP/1."
-
1
]
!=
'0'
);
_canReuse
=
(
headerLine
[
sizeof
"HTTP/1."
-
1
]
!=
'0'
);
}
}
_returnCode
=
headerLine
.
substring
(
9
,
headerLine
.
indexOf
(
' '
,
9
)).
toInt
();
int
codePos
=
headerLine
.
indexOf
(
' '
)
+
1
;
_returnCode
=
headerLine
.
substring
(
codePos
,
headerLine
.
indexOf
(
' '
,
codePos
)).
toInt
();
}
else
if
(
headerLine
.
indexOf
(
':'
))
{
}
else
if
(
headerLine
.
indexOf
(
':'
))
{
String
headerName
=
headerLine
.
substring
(
0
,
headerLine
.
indexOf
(
':'
));
String
headerName
=
headerLine
.
substring
(
0
,
headerLine
.
indexOf
(
':'
));
String
headerValue
=
headerLine
.
substring
(
headerLine
.
indexOf
(
':'
)
+
1
);
String
headerValue
=
headerLine
.
substring
(
headerLine
.
indexOf
(
':'
)
+
1
);
...
@@ -1450,4 +1452,4 @@ bool HTTPClient::setURL(const String& url)
...
@@ -1450,4 +1452,4 @@ bool HTTPClient::setURL(const String& url)
const
String
&
HTTPClient
::
getLocation
(
void
)
const
String
&
HTTPClient
::
getLocation
(
void
)
{
{
return
_location
;
return
_location
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment