From c7535950b6de086fce741809728129c79288dee8 Mon Sep 17 00:00:00 2001 From: Leo Kettmeir Date: Wed, 15 Feb 2023 16:37:41 +0100 Subject: feat(flash): add 2nd param to handler to get remote address (#17633) Closes #17583 --- ext/flash/01_http.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ext/flash/01_http.js') diff --git a/ext/flash/01_http.js b/ext/flash/01_http.js index 5152fd9e5..ff2eab63c 100644 --- a/ext/flash/01_http.js +++ b/ext/flash/01_http.js @@ -570,7 +570,16 @@ function createServe(opFn) { let resp; try { - resp = handler(req); + resp = handler(req, () => { + const { 0: hostname, 1: port } = core.ops.op_flash_addr( + serverId, + i, + ); + return { + hostname, + port, + }; + }); if (ObjectPrototypeIsPrototypeOf(PromisePrototype, resp)) { PromisePrototypeCatch( PromisePrototypeThen( -- cgit v1.2.3