Unverified Commit 31127f42 authored by t-oot's avatar t-oot Committed by GitHub

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.
parent 4365a454
...@@ -1264,6 +1264,8 @@ int HTTPClient::handleHeaderResponse() ...@@ -1264,6 +1264,8 @@ int HTTPClient::handleHeaderResponse()
log_d("Transfer-Encoding: %s", transferEncoding.c_str()); log_d("Transfer-Encoding: %s", transferEncoding.c_str());
if(transferEncoding.equalsIgnoreCase("chunked")) { if(transferEncoding.equalsIgnoreCase("chunked")) {
_transferEncoding = HTTPC_TE_CHUNKED; _transferEncoding = HTTPC_TE_CHUNKED;
} else if(transferEncoding.equalsIgnoreCase("identity")) {
_transferEncoding = HTTPC_TE_IDENTITY;
} else { } else {
return HTTPC_ERROR_ENCODING; return HTTPC_ERROR_ENCODING;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment