Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
useElectronNet throws error and breaks #443
When I make a get request with
Running the following code with electron demonstrates my issue.
The error it throws is:
The issue is the electron.ClientRequest object at line 224 (or 230 in current master of got/index.js does not have a
Am I missing something? Is this an issue with Electron? Any insight would be very helpful. Thanks!
Using #429, I bypassed the above error but got caught on a second error that I was getting before but didn't mention because I thought it was related to the first.
I'll see about opening an issue on Electron about the missing property.
Ok, so #429 did fix the first issue, and with 8.0.2 I get a bit further.
But I still get the second error I mentioned above. This error occurs in http-cache-semantics/index.js, in the function parseCacheControl. With useElectronNet set to false, this function receives a string, With useElectronNet set to true, though, it receives an array instead of length 1, containing the string that should be passed.
This still could be an issue with Electron.net not behaving in the same way as node's http, but I'm getting a bit lost trying to track down where it goes wrong.
Maybe I can fix this with the right options? I'm not sure.
Yeah, that's the issue.
In Got 8 we introduced two big features, progress events and caching, that rely on lower level HTTP functionality. We've noticed quite a few problems (#315) with
Are you also able to open an issue on Electron about strange header behaviour?
I found it has been reported a year ago in this issue. I've made a note that its affecting version 8.0.0 of got and asked for an update.
However, I did rewind to version 7.1.0 and it works fine. I believe I can live without the features of 8.0.0 for now, so that might be the fix for now if you really need to use Electron.net like I do.