Skip to content

Commit

Permalink
js - fix signedFetch::getHeaders, add clearTimeout (#55)
Browse files Browse the repository at this point in the history
Co-authored-by: robtfm <[email protected]>
  • Loading branch information
kuruk-mm and robtfm authored Sep 21, 2023
1 parent 9a7881a commit b803aef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/dcl/src/js/modules/SignedFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,13 @@ module.exports.signedFetch = async function (body) {
}

module.exports.getHeaders = async function (body) {
return await Deno.core.ops.op_signed_fetch_headers(body.url, body.init?.method);
const result = await Deno.core.ops.op_signed_fetch_headers(body.url, body.init?.method)

const headers = {}
for (var i=0; i< result.length; i++) {
headers[result[i][0]] = result[i][1];
}
return {
headers
}
}
1 change: 1 addition & 0 deletions crates/dcl/src/js/modules/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ globalThis.fetch = fetch.fetch;

import * as timers from "ext:deno_web/02_timers.js";
globalThis.setTimeout = timers.setTimeout;
globalThis.clearTimeout = timers.clearTimeout;

import * as websocket from "ext:deno_websocket/01_websocket.js";
globalThis.WebSocket = websocket.WebSocket;
Expand Down

0 comments on commit b803aef

Please sign in to comment.