Fix CORS issue

This commit is contained in:
Aurélien Georget 2019-02-22 15:25:11 +01:00
parent ceac222cb6
commit 4875649bc7
3 changed files with 3 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,6 @@ function* getVideos() {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
mode: 'no-cors',
}, },
false, false,
true, true,

View File

@ -9,7 +9,6 @@ import auth from 'utils/auth';
* @return {object} The parsed JSON from the request * @return {object} The parsed JSON from the request
*/ */
function parseJSON(response) { function parseJSON(response) {
// return response;
return response.json ? response.json() : response; return response.json ? response.json() : response;
} }
@ -21,7 +20,7 @@ function parseJSON(response) {
* @return {object|undefined} Returns either the response, or throws an error * @return {object|undefined} Returns either the response, or throws an error
*/ */
function checkStatus(response, checkToken = true) { function checkStatus(response, checkToken = true) {
if (response.status >= 200 && response.status < 300) { if ((response.status >= 200 && response.status < 300) || response.status === 0) {
return response; return response;
} }