dev: test for name %encodings

Massimo Melina committed May 16, 2023 at 23:19 UTC 4a654961a9a2a458678191a74c8e1aa4cd58688e
2 files changed +4
tests/config.yaml
+3
@@ -8,6 +8,8 @@ vfs:
8 protectFromAbove/child/*.txt:
9 can_read: false
10 children:
11 + - source: tests/alfa.txt
12 + name: x%#x
13 - name: protectFromAbove
14 children:
15 - name: child
@@ -116,3 +118,4 @@ accounts:
118 - admins
119 admins:
120 admin: true
121 +version: 0.45.0-beta12
tests/test.ts
+1
@@ -39,6 +39,7 @@ describe('basics', () => {
39 it('website', req('/f1/page/', { re:/This is a test/, mime:'text/html' }))
40 it('traversal', req('/f1/page/.%2e/.%2e/README.md', 418))
41 it('custom mime from above', req('/tests/page/index.html', { status: 200, mime:'text/plain' }))
42 + it('name encoding', req('/x%25%23x', 200))
43
44 it('missing perm', req('/for-admins/', 401))
45 it('missing perm.file', req('/for-admins/alfa.txt', 401))