Request URL seems to be a class, but not accessible
theduke opened this issue · comments
In a response handler, when doing console.log(request)
, the dump shows a url field of type `URL.
But trying to access that field returns an undefined
.
addEventListener('fetch', (req) => {
req.respondWith(handle(req));
});
async function handle(req) {
console.log({url: req.url});
return new Response('hello');
}
{
"url": undefined
}
Ah, never mind, misunderstanding.