wasmerio / winterjs

Winter is coming... ❄️

Home Page:https://winterjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.