From e38bc17a7b62d3881a834989ffe403f5ab22966c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 26 Aug 2016 09:36:25 -0700 Subject: [PATCH] Add regression spec for HTTP request over IPC --- spec/api-ipc-spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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}