Re: [whatwg/url] Allow `//` when base exists (#553)

Wouldn't it be extremely confusing that `//` would have very different behavior from `//a`?

Looking at https://github.com/nodejs/node/issues/35458 I think what you  want is something like this
```js
let finalURL = null;
try {
  finalURL = new URL(req.url);
} catch (e) {
  if (req.url.startsWith("/") {
    finalURL = new URL(`http://${req.headers.host}${req.url}`); // can you trust .host though?
  }
}
```
but it's worth clarifying with the HTTP specification what the exact behavior should be there (e.g., this does not account for `*`).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/553#issuecomment-707061204

Received on Monday, 12 October 2020 11:26:36 UTC