summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit/flash_test.ts4
-rw-r--r--cli/tsc/dts/lib.deno.unstable.d.ts2
2 files changed, 4 insertions, 2 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" } });
},
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts
index 822425d05..0362b416d 100644
--- a/cli/tsc/dts/lib.deno.unstable.d.ts
+++ b/cli/tsc/dts/lib.deno.unstable.d.ts
@@ -1126,7 +1126,7 @@ declare namespace Deno {
*
* @category HTTP Server
*/
- export type ServeHandler = (request: Request) => Response | Promise<Response>;
+ export type ServeHandler = (request: Request, getRemoteAddr: () => Deno.NetAddr) => Response | Promise<Response>;
/** **UNSTABLE**: New API, yet to be vetted.
*