Added proposed binary proxy response code
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { decodeB64StringToArrayBuffer } from "../utils/b64"
|
||||
|
||||
export const hasExtensionInstalled = () =>
|
||||
typeof window.__POSTWOMAN_EXTENSION_HOOK__ !== "undefined"
|
||||
|
||||
@@ -17,8 +19,16 @@ const extensionWithProxy = async (req, { state }) => {
|
||||
const { data } = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
|
||||
method: "post",
|
||||
url: state.postwoman.settings.PROXY_URL || "https://postwoman.apollosoftware.xyz/",
|
||||
data: req,
|
||||
data: {
|
||||
...req,
|
||||
wantsBinary: true,
|
||||
},
|
||||
})
|
||||
|
||||
if (data.isBinary) {
|
||||
data.data = decodeB64StringToArrayBuffer(data.data)
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user