You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get the IP address of the client when running declarative scripts through deno serve.
It seems the fetch method only accepts the first request parameter, and if I expect and address the connInfo parameter, I get an Internal Server Error and a console output of TypeError: Cannot read properties of undefined (reading 'remoteAddr').
Are declarative scripts intended to not have access to this additional information? Or have I overlooked something?
exportdefault{asyncfetch(request,connInfo){constclientIP=connInfo.remoteAddr.hostname;returnnewResponse(`Hello world! Your IP address is ${clientIP}`);},};
Version: Deno 1.44.0
I'm trying to get the IP address of the client when running declarative scripts through
deno serve
.It seems the fetch method only accepts the first
request
parameter, and if I expect and address theconnInfo
parameter, I get an Internal Server Error and a console output ofTypeError: Cannot read properties of undefined (reading 'remoteAddr')
.Are declarative scripts intended to not have access to this additional information? Or have I overlooked something?
Cheers,
Ben
(As reported on discord and added here on request)
The text was updated successfully, but these errors were encountered: