From ef4104a186ffc900a018f1e384fc97a418bda2d1 Mon Sep 17 00:00:00 2001 From: gozzy Date: Wed, 23 Nov 2022 11:42:59 +0000 Subject: [PATCH] cors config --- constants/variables.js | 17 ++++------------- services/graph.js | 4 ++-- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/constants/variables.js b/constants/variables.js index c4789f1..f7941b2 100644 --- a/constants/variables.js +++ b/constants/variables.js @@ -60,21 +60,12 @@ export const cachedEventsLength = { } } -export const corsConfig = (rpcUrl) => ({ - headers: [ - { - name: 'Access-Control-Allow-Origin', - value: rpcUrl - }, - { - name: 'Access-Control-Allow-Methods', - value: 'POST, GET, OPTIONS' - } - ], +export const httpConfig = { withCredentials: false, // buffer for tor connections - timeout: 30000 -}) + timeout: 30000, + keepAlive: true +} export const PROVIDERS = { walletConnect: { diff --git a/services/graph.js b/services/graph.js index d24a83e..5366358 100644 --- a/services/graph.js +++ b/services/graph.js @@ -39,7 +39,7 @@ const defaultOptions = { const client = new ApolloClient({ uri: link, - credentials: 'same-origin', + credentials: 'omit', cache: new InMemoryCache(), defaultOptions }) @@ -47,7 +47,7 @@ const client = new ApolloClient({ const registryClient = new ApolloClient({ uri: 'https://api.thegraph.com/subgraphs/name/tornadocash/tornado-relayer-registry', cache: new InMemoryCache(), - credentials: 'same-origin', + credentials: 'omit', defaultOptions })