Refactoring about how proxy fetching happens

This commit is contained in:
Zef Hemel
2023-08-23 19:08:21 +02:00
parent 38a95d2382
commit 5a88254cde
18 changed files with 320 additions and 93 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
import { base64Encode } from "../plugos/asset_bundle/base64.ts";
import { base64Decode, base64Encode } from "../plugos/asset_bundle/base64.ts";
export type ProxyFetchRequest = {
method?: string;
headers?: Record<string, string>;
body?: string;
base64Body?: string;
};
export type ProxyFetchResponse = {
@@ -23,7 +23,7 @@ export async function performLocalFetch(
req && {
method: req.method,
headers: req.headers,
body: req.body,
body: req.base64Body && base64Decode(req.base64Body),
},
);
return {