| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cad7dde commit 2bc136d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1125,7 +1125,7 @@ async function defaultResolve(specifier, context = {}, defaultResolveUnused) { | |||
| 1125 | 1125 | ) | |
| 1126 | 1126 | ) | |
| 1127 | 1127 | ) { | |
| 1128 | - return { url: specifier }; | ||
| 1128 | + return { url: parsed.href }; | ||
| 1129 | 1129 | } | |
| 1130 | 1130 | } catch { | |
| 1131 | 1131 | // Ignore exception | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,6 +61,10 @@ for (const { protocol, createServer } of [ | |||
| 61 | 61 | const host = new URL(base); | |
| 62 | 62 | host.protocol = protocol; | |
| 63 | 63 | host.hostname = hostname; | |
| 64 | + // /not-found is a 404 | ||
| 65 | + // ?redirect causes a redirect, no body. JSON.parse({status:number,location:string}) | ||
| 66 | + // ?mime sets the content-type, string | ||
| 67 | + // ?body sets the body, string | ||
| 64 | 68 | const server = createServer(function(_req, res) { | |
| 65 | 69 | const url = new URL(_req.url, host); | |
| 66 | 70 | const redirect = url.searchParams.get('redirect'); | |
@@ -133,6 +137,14 @@ for (const { protocol, createServer } of [ | |||
| 133 | 137 | assert.strict.equal(depsNS.data, 1); | |
| 134 | 138 | assert.strict.equal(depsNS.http, ns); | |
| 135 | 139 | ||
| 140 | + const relativeDeps = new URL(url.href); | ||
| 141 | + relativeDeps.searchParams.set('body', ` | ||
| 142 | + import * as http from "./"; | ||
| 143 | + export {http}; | ||
| 144 | + `); | ||
| 145 | + const relativeDepsNS = await import(relativeDeps.href); | ||
| 146 | + assert.strict.deepStrictEqual(Object.keys(relativeDepsNS), ['http']); | ||
| 147 | + assert.strict.equal(relativeDepsNS.http, ns); | ||
| 136 | 148 | const fileDep = new URL(url.href); | |
| 137 | 149 | const { href } = pathToFileURL(path('/es-modules/message.mjs')); | |
| 138 | 150 | fileDep.searchParams.set('body', ` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments