Rework scan screen, make lookups non-blocking, fix review findings
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
468cafc6db
commit
b5defb4e4f
46 files changed
+1957
-406
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { staticPath } from './static.ts';
|
||||
|
||||
test('static paths stay inside the web root', () => {
|
||||
const root = '/srv/dist/web';
|
||||
assert.equal(staticPath(root, '/'), '/srv/dist/web/index.html');
|
||||
assert.equal(staticPath(root, '/assets/app.js'), '/srv/dist/web/assets/app.js');
|
||||
assert.equal(staticPath(root, '/../webx/secret'), '/srv/dist/web/webx/secret');
|
||||
assert.equal(staticPath(root, '..%2Fwebx/secret'), null);
|
||||
assert.equal(staticPath(root, '/%2e%2e/%2e%2e/etc/passwd'), '/srv/dist/web/etc/passwd');
|
||||
assert.equal(staticPath(root, '/bad%zz'), null);
|
||||
assert.equal(staticPath(root, '/a%00b'), null);
|
||||
});
|
||||
Reference in new issue
Block a user