http request 'on end' not firing

  • When a POST is sent to the http server, the req.on('end', .... is not triggering.

    If I send
    from Postman to the http server, the headers that are received are

    { accept: 'application/json',
    'content-length': '12',
    'content-type': 'application/json',
    'user-agent': 'PostmanRuntime/7.26.10',
    'cache-control': 'no-cache',
    'postman-token': '73a1a41f-399b-4eb0-a142-79cb31db1aff',
    host: '',
    'accept-encoding': 'gzip, deflate, br',
    connection: 'keep-alive' }

    You can see the 'content-length' field is set to '12' which is the length of {state:true}

    However, req.on('end',..... never fires and Postman times out.

    If I set the 'content-length' to '11' manually in Postman and still send {state:true}, req.on('end',.... fires but obviously there is a missing } from the body. Tested this with '10' and '9' with similar results.

    I believe the issue is the code checking for the end of the body is doing length>'content-length' rather than length>='content-length'

  • Fixed this in the new version 1.6.1, which you can flash now! The PC versions cannot be downloaded yet, takes a day, but the ESP32+neonious one versions are already available.

Log in to reply