| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2b9fcdf commit 81cd7f3
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -356,7 +356,7 @@ function resolveDirectoryEntry(search) { | |||
| 356 | 356 | return resolveExtensions(new URL('index', search)); | |
| 357 | 357 | } | |
| 358 | 358 | ||
| 359 | - const encodedSepRegEx = /%2F|%2C/i; | ||
| 359 | + const encodedSepRegEx = /%2F|%5C/i; | ||
| 360 | 360 | /** | |
| 361 | 361 | * @param {URL} resolved | |
| 362 | 362 | * @param {string | URL | undefined} base | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,5 +2,8 @@ import '../common/index.mjs'; | |||
| 2 | 2 | import assert from 'assert'; | |
| 3 | 3 | // ./test-esm-ok.mjs | |
| 4 | 4 | import ok from '../fixtures/es-modules/test-%65%73%6d-ok.mjs'; | |
| 5 | + // ./test-esm-comma,.mjs | ||
| 6 | + import comma from '../fixtures/es-modules/test-esm-comma%2c.mjs'; | ||
| 5 | 7 | ||
| 6 | 8 | assert(ok); | |
| 9 | + assert(comma); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,10 +171,13 @@ import fromInside from '../fixtures/node_modules/pkgexports/lib/hole.js'; | |||
| 171 | 171 | })); | |
| 172 | 172 | } | |
| 173 | 173 | ||
| 174 | - // The use of %2F escapes in paths fails loading | ||
| 174 | + // The use of %2F and %5C escapes in paths fails loading | ||
| 175 | 175 | loadFixture('pkgexports/sub/..%2F..%2Fbar.js').catch(mustCall((err) => { | |
| 176 | 176 | strictEqual(err.code, 'ERR_INVALID_MODULE_SPECIFIER'); | |
| 177 | 177 | })); | |
| 178 | + loadFixture('pkgexports/sub/..%5C..%5Cbar.js').catch(mustCall((err) => { | ||
| 179 | + strictEqual(err.code, 'ERR_INVALID_MODULE_SPECIFIER'); | ||
| 180 | + })); | ||
| 178 | 181 | ||
| 179 | 182 | // Package export with numeric index properties must throw a validation error | |
| 180 | 183 | loadFixture('pkgexports-numeric').catch(mustCall((err) => { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,13 +53,15 @@ const { requireImport, importImport } = importer; | |||
| 53 | 53 | // Backtracking below the package base | |
| 54 | 54 | ['#subpath/sub/../../../belowbase', 'request is not a valid subpath'], | |
| 55 | 55 | // Percent-encoded slash errors | |
| 56 | - ['#external/subpath/x%2Fy', 'must not include encoded "/"'], | ||
| 56 | + ['#external/subpath/x%2Fy', 'must not include encoded "/" or "\\"'], | ||
| 57 | + ['#external/subpath/x%5Cy', 'must not include encoded "/" or "\\"'], | ||
| 57 | 58 | // Target must have a name | |
| 58 | 59 | ['#', '#'], | |
| 59 | 60 | // Initial slash target must have a leading name | |
| 60 | 61 | ['#/initialslash', '#/initialslash'], | |
| 61 | 62 | // Percent-encoded target paths | |
| 62 | - ['#percent', 'must not include encoded "/"'], | ||
| 63 | + ['#encodedslash', 'must not include encoded "/" or "\\"'], | ||
| 64 | + ['#encodedbackslash', 'must not include encoded "/" or "\\"'], | ||
| 63 | 65 | ]); | |
| 64 | 66 | ||
| 65 | 67 | for (const [specifier, expected] of invalidImportSpecifiers) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,10 @@ importFixture('as%2Ff').catch(mustCall((err) => { | |||
| 7 | 7 | strictEqual(err.code, 'ERR_INVALID_MODULE_SPECIFIER'); | |
| 8 | 8 | })); | |
| 9 | 9 | ||
| 10 | + importFixture('as%5Cf').catch(mustCall((err) => { | ||
| 11 | + strictEqual(err.code, 'ERR_INVALID_MODULE_SPECIFIER'); | ||
| 12 | + })); | ||
| 13 | + | ||
| 10 | 14 | importFixture('as\\df').catch(mustCall((err) => { | |
| 11 | 15 | strictEqual(err.code, 'ERR_INVALID_MODULE_SPECIFIER'); | |
| 12 | 16 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,7 @@ | |||
| 26 | 26 | "#": "./test.js", | |
| 27 | 27 | "#/initialslash": "./test.js", | |
| 28 | 28 | "#notfound": "./notfound.js", | |
| 29 | - "#percent": "./..%2F/x.js" | ||
| 29 | + "#encodedslash": "./..%2F/x.js", | ||
| 30 | + "#encodedbackslash": "./..%5C/x.js" | ||
| 30 | 31 | } | |
| 31 | 32 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + export default ','; | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments