wasmerio / winterjs

Winter is coming... ❄️
https://winterjs.org/
MIT License
3.05k stars 53 forks source link

Request URL seems to be a class, but not accessible #20

Closed theduke closed 1 year ago

theduke commented 1 year ago

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
}
theduke commented 1 year ago

Ah, never mind, misunderstanding.