proxy.hoppscotch.io (#1532)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Liyas Thomas
2021-03-14 08:54:15 +05:30
committed by GitHub
parent c6af38f7dc
commit a724dc1207
23 changed files with 62 additions and 61 deletions

View File

@@ -13,7 +13,7 @@ export const cancelRunningAxiosRequest = () => {
const axiosWithProxy = async (req, { state }) => {
try {
const { data } = await axios.post(
state.postwoman.settings.PROXY_URL || "https://hoppscotch.apollosoftware.xyz/",
state.postwoman.settings.PROXY_URL || "https://proxy.hoppscotch.io",
{
...req,
wantsBinary: true,

View File

@@ -16,18 +16,18 @@ export const cancelRunningExtensionRequest = () => {
}
const extensionWithProxy = async (req, { state }) => {
const backupTimeDataStart = new Date().getTime();
const backupTimeDataStart = new Date().getTime()
const res = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
method: "post",
url: state.postwoman.settings.PROXY_URL || "https://hoppscotch.apollosoftware.xyz/",
url: state.postwoman.settings.PROXY_URL || "https://proxy.hoppscotch.io",
data: {
...req,
wantsBinary: true,
},
})
const backupTimeDataEnd = new Date().getTime();
const backupTimeDataEnd = new Date().getTime()
const parsedData = JSON.parse(res.data)
@@ -40,11 +40,11 @@ const extensionWithProxy = async (req, { state }) => {
}
if (!(res && res.config && res.config.timeData)) {
res.config = {
res.config = {
timeData: {
startTime: backupTimeDataStart,
endTime: backupTimeDataEnd
}
endTime: backupTimeDataEnd,
},
}
}
@@ -54,21 +54,21 @@ const extensionWithProxy = async (req, { state }) => {
}
const extensionWithoutProxy = async (req, _store) => {
const backupTimeDataStart = new Date().getTime();
const backupTimeDataStart = new Date().getTime()
const res = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
...req,
wantsBinary: true,
})
const backupTimeDataEnd = new Date().getTime();
const backupTimeDataEnd = new Date().getTime()
if (!(res && res.config && res.config.timeData)) {
res.config = {
timeData: {
startTime: backupTimeDataStart,
endTime: backupTimeDataEnd
}
endTime: backupTimeDataEnd,
},
}
}
return res