From 1d60cb638947193238550fc3cc085ebfac12b864 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Tue, 6 Oct 2015 11:52:30 +0200 Subject: [PATCH 1/3] Using node-fetch until Electron ignores CORS --- lib/fetch-redmine.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/fetch-redmine.js b/lib/fetch-redmine.js index f980fe9..3275a7a 100644 --- a/lib/fetch-redmine.js +++ b/lib/fetch-redmine.js @@ -1,7 +1,7 @@ 'use babel'; -// import fetch from 'node-fetch'; -import {} from 'whatwg-fetch'; +import fetch, {Headers, Request, Response} from 'node-fetch'; +// import {} from 'whatwg-fetch'; import querystring from 'querystring'; export default class Redmine { @@ -13,15 +13,16 @@ export default class Redmine { options(method='GET') { return { + // mode: 'no-cors', method: method, headers: this.headers() }; } headers() { - return { + return new Headers({ 'X-Redmine-API-Key': this.apiKey - }; + }); } fetch(path, params={}, method='GET') { From 4af0c9179fb4be18f8182947dd28996dfc144cbb Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Tue, 6 Oct 2015 13:31:44 +0200 Subject: [PATCH 2/3] Upated dependencies, removed whatwg-fetch --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 6127c5a..bee4590 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,8 @@ "atom": ">=0.174.0 <2.0.0" }, "dependencies": { - "atom-space-pen-views": "^2.0.5", - "season": "^5.2.0", - "node-fetch": "^1.2.1", - "whatwg-fetch": "^0.8.2" + "atom-space-pen-views": "~2.1.0", + "season": "~5.3.0", + "node-fetch": "~1.3.3" } } From 0c7990f881db1b91605839b7f02440de010eb449 Mon Sep 17 00:00:00 2001 From: Timo Uhlmann Date: Tue, 6 Oct 2015 13:31:59 +0200 Subject: [PATCH 3/3] Bumped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bee4590..54b518d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "redmine", "main": "./lib/redmine", - "version": "0.2.1", + "version": "0.2.2", "description": "View and open your Redmine issues in Atom.", "keywords": ["redmine", "issues"], "activationCommands": {