commit 464d046b5a26cc6edfd8937041bc37bc0ef82328
parent ac8b971cc0dcb4846405ed782a2a8c39fd3d9e32
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 17 Dec 2024 17:24:16 +0000
append-path spec behaviour for repeated /
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/pkgs/anoia/init.fnl b/pkgs/anoia/init.fnl
@@ -84,6 +84,8 @@
(false err) (expect (string.match err "path traversal"))))]
(expect= (append-path "/tmp" "hello") "/tmp/hello")
(expect= (append-path "/tmp/" "hello") "/tmp/hello")
+ (expect= (append-path "/tmp/" "///hello") "/tmp/hello")
+ (expect= (append-path "/tmp/" "///hello/../fish") "/tmp/fish")
(traps "/tmp/" "../hello")
(expect= (append-path "/tmp/" "hello/../goodbye") "/tmp/goodbye")
(traps "/tmp/" "hello/../../goodbye"))