diff --git a/app/__mocks__/node-forge.js b/app/__mocks__/node-forge.js
new file mode 100644
index 000000000..32a349b53
--- /dev/null
+++ b/app/__mocks__/node-forge.js
@@ -0,0 +1,65 @@
+/*
+ * This is a stupid little mock that basically disabled encryption.
+ * The reason it is needed is because the Forge module loader doesn't
+ * play along with Jest.
+ */
+
+module.exports = function (options) {
+ const forge = require('../../node_modules/node-forge/js/forge')(options);
+
+ forge.util = {
+ hexToBytes: forge.hexToBytes,
+ bytesToHex: forge.bytesToHex,
+ createBuffer (text) {
+ return new Buffer(text);
+ }
+ };
+
+ forge.pkcs5 = {
+ pbkdf2 () {
+
+ }
+ };
+
+ forge.random = {
+ getBytesSync(n) {
+ let s = '';
+ for (let i = 0; i < n; i++) {
+ s += 'a';
+ }
+ return s;
+ }
+ };
+
+ forge.cipher = {
+ createCipher(alg, key) {
+ return {
+ start(config) {
+ this._config = config;
+ },
+ update(buffer) {
+ this._data = buffer;
+ },
+ finish() {
+ this.mode = {tag: 'tag'};
+ this.output = this._data;
+ }
+ };
+ },
+ createDecipher(alg, key) {
+ return {
+ start (config) {
+ this._config = config;
+ },
+ update (buffer) {
+ this.output = buffer;
+ },
+ finish () {
+ return true;
+ }
+ };
+ }
+ };
+
+ return forge;
+};
diff --git a/app/analytics/index.js b/app/analytics/index.js
index e293ed584..9b407be0e 100644
--- a/app/analytics/index.js
+++ b/app/analytics/index.js
@@ -9,12 +9,10 @@ export async function init (accountId) {
return;
}
- process.nextTick(() => {
- google.init(accountId, getAppPlatform(), getAppVersion());
- segment.init();
+ await segment.init();
+ await google.init(accountId, getAppPlatform(), getAppVersion());
- initialized = true;
- });
+ initialized = true;
ipcRenderer.on('analytics-track-event', (_, args) => {
trackEvent(...args);
diff --git a/app/common/constants.js b/app/common/constants.js
index 463b2ffc6..eea591b8a 100644
--- a/app/common/constants.js
+++ b/app/common/constants.js
@@ -121,7 +121,7 @@ export const CONTENT_TYPE_OTHER = '';
export const contentTypesMap = {
[CONTENT_TYPE_JSON]: 'JSON',
[CONTENT_TYPE_XML]: 'XML',
- [CONTENT_TYPE_FORM_DATA]: 'Form Data',
+ [CONTENT_TYPE_FORM_DATA]: 'Multipart Form',
[CONTENT_TYPE_FORM_URLENCODED]: 'Url Encoded',
[CONTENT_TYPE_FILE]: 'Binary File',
[CONTENT_TYPE_OTHER]: 'Other'
diff --git a/app/models/request.js b/app/models/request.js
index bec500f29..426a0cd43 100644
--- a/app/models/request.js
+++ b/app/models/request.js
@@ -107,6 +107,8 @@ export function updateMimeType (request, mimeType, doCreate = false) {
body = newBodyForm(request.body.params || []);
} else if (mimeType === CONTENT_TYPE_FILE) {
body = newBodyFile('');
+ } else if (typeof mimeType !== 'string') {
+ body = newBodyRaw('');
} else {
body = newBodyRaw(request.body.text || '', mimeType);
}
diff --git a/app/package.json b/app/package.json
index 07be48b2a..c69d0d355 100644
--- a/app/package.json
+++ b/app/package.json
@@ -22,11 +22,10 @@
"mime-types": "^2.1.12",
"mkdirp": "^0.5.1",
"nedb": "^1.8.0",
- "node-forge": "^0.6.43",
+ "node-forge": "^0.6.46",
"nunjucks": "^3.0.0",
"raven": "^0.12.1",
"request": "^2.71.0",
- "sjcl": "^1.0.6",
"srp": "git@github.com:getinsomnia/srp-js.git#6ebd8c3acfbcf69645e4c6e6f8f6b55138ff22c3",
"tough-cookie": "^2.3.1",
"traverse": "^0.6.6",
diff --git a/app/renderer.html b/app/renderer.html
index 5c99e98b9..74d7c677c 100644
--- a/app/renderer.html
+++ b/app/renderer.html
@@ -117,16 +117,5 @@
// SOME HELPERS
document.body.setAttribute('data-platform', process.platform);
-
-
-
-