diff --git a/preload/src/api/https.js b/preload/src/api/https.js index dae2ac0f..42713097 100644 --- a/preload/src/api/https.js +++ b/preload/src/api/https.js @@ -1,6 +1,6 @@ import * as https from "https"; -const methods = ["get", "put", "post", "delete"]; +const methods = ["get", "put", "post", "delete", "head"]; const redirectCodes = new Set([301, 302, 307, 308]); const headersToClone = ["statusCode", "statusMessage", "url", "headers", "method", "aborted", "complete", "rawHeaders", "end"]; diff --git a/renderer/src/polyfill/fs.js b/renderer/src/polyfill/fs.js index 41226a6f..4db835ca 100644 --- a/renderer/src/polyfill/fs.js +++ b/renderer/src/polyfill/fs.js @@ -179,6 +179,8 @@ export default { rmSync, rmdir, rmdirSync, + stat, + statSync, unlink, unlinkSync, watch, diff --git a/renderer/src/polyfill/index.js b/renderer/src/polyfill/index.js index ac8207b7..0bddb075 100644 --- a/renderer/src/polyfill/index.js +++ b/renderer/src/polyfill/index.js @@ -1,10 +1,10 @@ import EventEmitter from "@common/events"; import Module from "./module"; -import * as vm from "./vm"; -import * as fs from "./fs"; +import vm from "./vm"; +import fs from "./fs"; import request from "./request"; -import * as https from "./https"; +import https from "./https"; import Buffer from "./buffer"; import crypto from "./crypto"; import Remote from "./remote"; diff --git a/renderer/src/polyfill/vm.js b/renderer/src/polyfill/vm.js index 56ae545d..66b065eb 100644 --- a/renderer/src/polyfill/vm.js +++ b/renderer/src/polyfill/vm.js @@ -7,4 +7,6 @@ export const compileFunction = function(code, params = [], options = {}) { const syntaxError = new SyntaxError(returned.message); syntaxError.stack = returned.stack; throw syntaxError; -}; \ No newline at end of file +}; + +export default {compileFunction}; \ No newline at end of file