Skip to content

Commit 71cb32a

Browse files
committed
fix: fixing #187 - saving binary files
Signed-off-by: Pawel Psztyc <[email protected]>
1 parent 9f42a50 commit 71cb32a

File tree

3 files changed

+59
-43
lines changed

3 files changed

+59
-43
lines changed

package-lock.json

Lines changed: 50 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "advanced-rest-client",
33
"description": "The Advanced REST Client desktop application.",
4-
"version": "0.0.0-no-version",
4+
"version": "16.0.7-alpha",
55
"homepage": "https://advancedrestclient.com",
66
"license": "Apache-2.0",
77
"author": {
@@ -66,7 +66,7 @@
6666
"@types/mime-types": "^2.1.0",
6767
"@types/mocha": "^8.2.0",
6868
"@types/pouchdb": "^6.4.0",
69-
"api-console": "^6.4.0",
69+
"api-console": "^6.4.3",
7070
"babel-eslint": "^10.1.0",
7171
"chai": "^4.3.0",
7272
"chance": "^1.1.7",
@@ -87,14 +87,14 @@
8787
"pouchdb": "^7.2.2",
8888
"sinon": "^9.2.4",
8989
"spectron": "^13.0.0",
90-
"typescript": "^4.1.3",
90+
"typescript": "^4.1.4",
9191
"typescript-lit-html-plugin": "^0.9.0"
9292
},
9393
"dependencies": {
9494
"@advanced-rest-client/arc-events": "^0.2.14",
9595
"@advanced-rest-client/arc-types": "^0.2.49",
9696
"@advanced-rest-client/electron-amf-service": "^5.0.0",
97-
"@advanced-rest-client/electron-oauth2": "^5.0.1",
97+
"@advanced-rest-client/electron-oauth2": "^5.0.4",
9898
"@advanced-rest-client/electron-request": "^3.1.1",
9999
"@advanced-rest-client/google-drive-browser": "^4.0.0",
100100
"@advanced-rest-client/host-rules-editor": "^4.0.0",

src/preload/FilesystemProxy.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,13 @@ export class FilesystemProxy {
100100
*/
101101
[writeContent](filePath, content, mime) {
102102
let data = content;
103-
if (typeof content !== 'string') {
103+
if (typeof content !== 'string' && mime === 'application/json') {
104104
data = this[prepareData](content, mime);
105105
}
106-
return fs.writeFile(filePath, data, 'utf8');
106+
if (typeof data === 'string') {
107+
return fs.writeFile(filePath, data, 'utf8');
108+
}
109+
return fs.writeFile(filePath, data);
107110
}
108111

109112
/**

0 commit comments

Comments
 (0)