Skip to content

ESP32S2 Content-Length: 0 responses timeout, sometimes exception #3420

@anecdata

Description

@anecdata

This URL returns a valid HTTP 200 status code, headers including a 'Content-Length': '0' header, and no message-body.

This URL / code:

for _ in range(0, 5):
    response = requests.get("https://httpbin.org/status/200")
    print(response.status_code)
    print(response.reason)
    print(response.headers)
    print(response.text)

returns right away (less than a second) consistently in a browser or in python 3 (macOS).

In CircuitPython, each iteration takes about a minute to return, and sometimes gets an exception (usually the exception can happen in a loop of a few iterations):

RuntimeError: Unable to read HTTP response.

Interestingly, a shorter requests timeout in CircuitPython: requests.get("https://httpbin.org/status/200", timeout=5), comes back in 5 seconds rather than a minute, and seems far less prone to the "Unable to read HTTP response" exception so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugespressifapplies to multiple Espressif chips

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions