diff --git a/spec/api-ipc-spec.js b/spec/api-ipc-spec.js index 9231fb042d00..6b8754a772f4 100644 --- a/spec/api-ipc-spec.js +++ b/spec/api-ipc-spec.js @@ -1,6 +1,7 @@ 'use strict' const assert = require('assert') +const http = require('http') const path = require('path') const {closeWindow} = require('./window-helpers') @@ -325,6 +326,16 @@ describe('ipc module', function () { ipcRenderer.send('message', document.location) }) + it('does not crash on HTTP request objects (regression)', function (done) { + const request = http.request({port: 5000, hostname: '127.0.0.1', method: 'GET', path: '/'}) + ipcRenderer.once('message', function (event, value) { + assert.equal(value.method, 'GET') + assert.equal(value.path, '/') + done() + }) + ipcRenderer.send('message', request) + }) + it('can send objects that both reference the same object', function (done) { const child = {hello: 'world'} const foo = {name: 'foo', child: child}