benjie/mehserve

`ECONNRESET` not being handled

benjie opened this issue ยท 1 comments

~ ๐Ÿ’ƒ  ๐Ÿ‘‰  mehserve run --exponential-backoff
Exponential backoff enabled, with 25 attempts
mehserve v2.0.0-2 listening on port 12439
mehserve v2.0.0-2 (SSL) listening on port 12443
_http_server.js:188
    throw new RangeError(`Invalid status code: ${originalStatusCode}`);
    ^

RangeError: Invalid status code: ECONNRESET
    at ServerResponse.writeHead (_http_server.js:188:11)
    at ServerResponse._implicitHeader (_http_server.js:179:8)
    at write_ (_http_outgoing.js:630:9)
    at ServerResponse.end (_http_outgoing.js:749:5)
    at /usr/local/lib/node_modules/mehserve/index.js:71:7
    at cb (/usr/local/lib/node_modules/mehserve/index.js:205:34)
    at ClientRequest.proxyError (/usr/local/lib/node_modules/mehserve/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:154:11)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at Socket.socketOnEnd (_http_client.js:421:9)

This was caused by a server that accepted the connection then closed the socket without sending any data.

Causes mehserve to crash.