grantila / fetch-h2

HTTP/1+2 Fetch API client for Node.js
MIT License
336 stars 16 forks source link

fix(context-http1): fix disconnectAll #96

Open stefan-guggisberg opened 4 years ago

stefan-guggisberg commented 4 years ago

There's a bug in the Http1 disconnectAll implementation. https://github.com/grantila/fetch-h2/blob/master/lib/context-http1.ts#L141 is never executed because the waiting array is truncated on the preceding line.

This PR fixes this by copying the waiting array.

stefan-guggisberg commented 4 years ago

@grantila I am still struggling with dangling http1 connections despite calling disconnectAll() and stumbled over this issue while debugging. Fixing it doesn't solve my dangling connections problem but I thought it's worth reporting anyway.