-
-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useElectronNet throws error and breaks #443
Comments
Can you try #429 and see if it fixes your problems? Can you also open an issue on Electron about adding the missing |
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. The parseCacheControl(res.headers['cache-control']);
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. |
Closing this in favor of #899 |
When I make a get request with
useElectronNet: true
within an Electron app, got breaks. Set to true, there is no issue and the request goes through fine. I am using electron 1.7.10 and got 8.0.1.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
connection
property. This isn't an issue with the http.ClientRequest used when useElectronNet is set to true.Am I missing something? Is this an issue with Electron? Any insight would be very helpful. Thanks!
The text was updated successfully, but these errors were encountered: