Skip to content

Commit 31127f4

Browse files
author
t-oot
authored
Support for Transfer-Encoding headers that specify "identify" (#5486)
In [HTTPClient](https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPClient), if the `Transfer-Encoding` header is set to `identity`, an error (Transfer-Encoding not supported) will occur. HTTPClient will consider the request as `identity` if the `Transfer-Encoding` header is not set. But it is also defined a response with `identity` explicitly set in the `Transfer-Encoding` header (ref:[MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding)). This pull request will allow the request to be processed normally even when `identity` is explicitly set.
1 parent 4365a45 commit 31127f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/HTTPClient/src/HTTPClient.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,8 @@ int HTTPClient::handleHeaderResponse()
12641264
log_d("Transfer-Encoding: %s", transferEncoding.c_str());
12651265
if(transferEncoding.equalsIgnoreCase("chunked")) {
12661266
_transferEncoding = HTTPC_TE_CHUNKED;
1267+
} else if(transferEncoding.equalsIgnoreCase("identity")) {
1268+
_transferEncoding = HTTPC_TE_IDENTITY;
12671269
} else {
12681270
return HTTPC_ERROR_ENCODING;
12691271
}

0 commit comments

Comments
 (0)