From 1d5bdff96c86103c0cd8145ca9bd6d413420d26a Mon Sep 17 00:00:00 2001 From: kurpfish Date: Thu, 5 Aug 2021 16:52:18 +0300 Subject: [PATCH] no-cors mode test --- src/server/server.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/server.js b/src/server/server.js index 8effa413..15257f45 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -1,6 +1,8 @@ export const fetchProfile = async (link, index) => { try { const response = await fetch(`${link}${index}`, { + method: 'GET', + mode: 'no-cors', headers: { 'Access-Control-Request-Headers': 'authorization', 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`, @@ -16,6 +18,8 @@ export const fetchProfile = async (link, index) => { export const fetchSkills = async (link) => { try { const response = await fetch(link, { + method: 'GET', + mode: 'no-cors', headers: { 'Access-Control-Request-Headers': 'authorization', 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`, @@ -32,8 +36,10 @@ export const fetchItemsForId = async (link, id) => { console.log(`Bearer ${localStorage.getItem('auth_token')}`); try { const response = await fetch(`${link}${id}`, { + method: 'GET', + mode: 'no-cors', headers: { - // 'Access-Control-Request-Headers': 'authorization', + 'Access-Control-Request-Headers': 'authorization', 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`, 'Origin': `${process.env.REACT_APP_BASE_URL}`, } @@ -48,6 +54,7 @@ export const fetchForm = async (link, info) => { try { const response = await fetch(link, { method: 'POST', + mode: 'no-cors', headers: { 'Access-Control-Request-Headers': 'authorization', 'Authorization': `Bearer ${localStorage.getItem('auth_token')}`,