Added "body" support to fetch
This commit is contained in:
parent
8dac58f38a
commit
d3c58da4bf
@ -3,6 +3,7 @@ import { base64Decode } from "../../plugos/asset_bundle/base64.ts";
|
|||||||
export type SandboxFetchRequest = {
|
export type SandboxFetchRequest = {
|
||||||
method?: string;
|
method?: string;
|
||||||
headers?: Record<string, string>;
|
headers?: Record<string, string>;
|
||||||
|
body?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SandboxFetchResponse = {
|
export type SandboxFetchResponse = {
|
||||||
@ -32,6 +33,7 @@ export function monkeyPatchFetch() {
|
|||||||
init && {
|
init && {
|
||||||
method: init.method,
|
method: init.method,
|
||||||
headers: init.headers as Record<string, string>,
|
headers: init.headers as Record<string, string>,
|
||||||
|
body: init.body as string,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return new Response(base64Decode(r.base64Body), {
|
return new Response(base64Decode(r.base64Body), {
|
||||||
|
Loading…
Reference in New Issue
Block a user