Skip to content

Commit

Permalink
fix: format fixes; lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdickinson committed Nov 13, 2023
1 parent 49e33ac commit d845f31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions src/background-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ class HttpContext {
return 0n;
}

let { header, url: rawUrl, method } = req.json();
method ??= 'GET';
const { header, url: rawUrl, method: m } = req.json();
const method = m ?? 'GET';
const url = new URL(rawUrl);

const isAllowed = this.allowedHosts.some((allowedHost) => {
Expand Down
9 changes: 0 additions & 9 deletions src/mod.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,6 @@ if (typeof WebAssembly === 'undefined') {
});

test('http works as expected when host is allowed', async () => {
const functions = {
'extism:host/user': {
async hello_world(context: CallContext, _off: bigint) {
await new Promise((resolve) => setTimeout(resolve, 100));
return context.store('it works');
},
},
};

const plugin = await createPlugin(
{ wasm: [{ name: 'http', url: 'http://localhost:8124/wasm/http.wasm' }] },
{ useWasi: true, functions: {}, runInWorker: true, allowedHosts: ['*.typicode.com'] },
Expand Down

0 comments on commit d845f31

Please sign in to comment.