diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-02-15 16:37:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-15 16:37:41 +0100 |
commit | c7535950b6de086fce741809728129c79288dee8 (patch) | |
tree | 016b274136e8f656d420f6bda79740dfc3fb09f7 /cli/tests/unit/flash_test.ts | |
parent | 4104a674c7955eb7811b241b2e18453ac96faaf5 (diff) |
feat(flash): add 2nd param to handler to get remote address (#17633)
Closes #17583
Diffstat (limited to 'cli/tests/unit/flash_test.ts')
-rw-r--r-- | cli/tests/unit/flash_test.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/tests/unit/flash_test.ts b/cli/tests/unit/flash_test.ts index 9ed0276a6..0924aab66 100644 --- a/cli/tests/unit/flash_test.ts +++ b/cli/tests/unit/flash_test.ts @@ -89,12 +89,14 @@ Deno.test({ permissions: { net: true } }, async function httpServerBasic() { const listeningPromise = deferred(); const server = Deno.serve({ - handler: async (request) => { + handler: async (request, getRemoteAddr) => { // FIXME(bartlomieju): // make sure that request can be inspected console.log(request); assertEquals(new URL(request.url).href, "http://127.0.0.1:4501/"); assertEquals(await request.text(), ""); + const addr = getRemoteAddr(); + assertEquals(addr.hostname, "127.0.0.1"); promise.resolve(); return new Response("Hello World", { headers: { "foo": "bar" } }); }, |