stream-http
stream-http copied to clipboard
Prevented uncaught exception if body is null (fixes MS Edge `getReader` bug)
@jhiesey can you merge this pr ? I'm stuck like @charlesfries with this problem. Thank you
Can you submit a unit test with this fix?
This one is a bit difficult to submit a test fix with. Edge is now based on chrome and does not exercise this now, and haven't been able to get a copy of legacy edge on mac.
But that is not my problem. I am seeing body be undefined on a fetch in an android webview on a status 401, but can't quite get the test setup to duplicate it in these tests.
The fix is essentially a null check, low risk, and the proper way to test it would be via an actual unit test on the class, not getting express to do something a little funky in an integration test.
This current bug breaks the https://github.com/Yaffle/EventSource polyfill when it's used with the commonly used https://github.com/parshap/node-libs-react-native library that uses stream-http.
I would really rather you allowed this in. Thank you!!
We have an app running in an Android webview and with the latest release last week of Chrome webview (113.0.5672.76) (any version we tested with a major version 113) we started having an issue with am unhandled promise exception
Unhandled Promise rejection: Cannot read properties of null (reading 'getReader') ; Zone:
We had no problems with any other versions of webview we tested with.
This change appears to have fixed our issue (found it after spending most of the day testing/debugging)