From bd008f42dd358e5ce41d1720fee971d093bb9202 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Tue, 14 Jan 2020 11:49:43 -0500 Subject: [PATCH] Refactor network and ProxyStrategy code --- functions/network.js | 6 +++--- functions/strategies/ProxyStrategy.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/network.js b/functions/network.js index f2089363e..f4ad8ec66 100644 --- a/functions/network.js +++ b/functions/network.js @@ -5,9 +5,9 @@ import ProxyStrategy from "./strategies/ProxyStrategy"; const sendNetworkRequest = (req, store) => { if (store.state.postwoman.settings.PROXY_ENABLED) { return ProxyStrategy(req, store); - } else { - return AxiosStrategy(req, store); - } + } + + return AxiosStrategy(req, store); } export { sendNetworkRequest }; diff --git a/functions/strategies/ProxyStrategy.js b/functions/strategies/ProxyStrategy.js index 9cac6f47d..f28762d68 100644 --- a/functions/strategies/ProxyStrategy.js +++ b/functions/strategies/ProxyStrategy.js @@ -1,13 +1,13 @@ import axios from "axios"; const proxyStrategy = async (req, store) => { - const proxyRes = await axios.post( + const { data } = await axios.post( store.state.postwoman.settings.PROXY_URL || "https://postwoman.apollotv.xyz/", req ); - return proxyRes.data; + return data; } export default proxyStrategy;