Skip to content

Commit

Permalink
Using node-fetch until Electron ignores CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
amiuhle committed Oct 6, 2015
1 parent dc9741b commit 1d60cb6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/fetch-redmine.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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') {
Expand Down

0 comments on commit 1d60cb6

Please sign in to comment.