From 31127f4260cc643493b619064abdd409511e2b2c Mon Sep 17 00:00:00 2001 From: t-oot Date: Mon, 2 Aug 2021 21:04:48 +0900 Subject: [PATCH] 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. --- libraries/HTTPClient/src/HTTPClient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp index c0a801a4..e7a8ecb8 100644 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ b/libraries/HTTPClient/src/HTTPClient.cpp @@ -1264,6 +1264,8 @@ int HTTPClient::handleHeaderResponse() log_d("Transfer-Encoding: %s", transferEncoding.c_str()); if(transferEncoding.equalsIgnoreCase("chunked")) { _transferEncoding = HTTPC_TE_CHUNKED; + } else if(transferEncoding.equalsIgnoreCase("identity")) { + _transferEncoding = HTTPC_TE_IDENTITY; } else { return HTTPC_ERROR_ENCODING; }