Fixes #1528
Deno 2.5 somehow regressed on fetch-related typing, not sure what's going on here for now adding a bunch of "as any" casts.
This commit is contained in:
@@ -177,10 +177,14 @@ export function monkeyPatchFetch() {
|
||||
base64Body: encodedBody,
|
||||
},
|
||||
);
|
||||
return new Response(r.base64Body ? base64Decode(r.base64Body) : null, {
|
||||
status: r.status,
|
||||
headers: r.headers,
|
||||
});
|
||||
// Casting the response to "any" for now, since of weird Deno typing
|
||||
return new Response(
|
||||
(r.base64Body ? base64Decode(r.base64Body) : null) as any,
|
||||
{
|
||||
status: r.status,
|
||||
headers: r.headers,
|
||||
},
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -38,7 +38,8 @@ export async function performLocalFetch(
|
||||
method: req.method,
|
||||
headers: req.headers,
|
||||
body: req.base64Body && base64Decode(req.base64Body),
|
||||
},
|
||||
// Casting to "any" for now, since of weird Deno typing
|
||||
} as any,
|
||||
);
|
||||
return {
|
||||
ok: result.ok,
|
||||
|
||||
@@ -181,7 +181,8 @@ export class HttpSpacePrimitives implements SpacePrimitives {
|
||||
{
|
||||
method: "PUT",
|
||||
headers,
|
||||
body: data,
|
||||
// Casting to any because of weird Deno typing
|
||||
body: data as any,
|
||||
},
|
||||
);
|
||||
return this.responseToMeta(name, res);
|
||||
|
||||
@@ -164,7 +164,8 @@ async function handleLocalFileRequest(
|
||||
if (data) {
|
||||
// console.log("Serving from space", path);
|
||||
return new Response(
|
||||
data.data,
|
||||
// Casting to any because of weird Deno typing
|
||||
data.data as any,
|
||||
{
|
||||
headers: {
|
||||
"Content-type": data.meta.contentType,
|
||||
|
||||
@@ -79,7 +79,8 @@ export function sandboxFetchSyscalls(
|
||||
fetchOptions.headers = fetchOptions.headers ?? {};
|
||||
const resp = await client.httpSpacePrimitives.authenticatedFetch(
|
||||
buildProxyUrl(client, url),
|
||||
fetchOptions,
|
||||
// Casting this to any because of weird Deno typing
|
||||
fetchOptions as any,
|
||||
);
|
||||
const body = await resp.arrayBuffer();
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user