Skip to content

Commit b9c76cf

Browse files
Add a contains_path_traversal(url::URI) method
Co-authored-by: Tanmay Mohapatra <[email protected]>
1 parent cf38727 commit b9c76cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
function contains_path_traversal(url)
1+
contains_path_traversal(url::URI) = contains_path_traversal(url.path)
2+
function contains_path_traversal(url::AbstractString)
23
# Patterns:
34
# ../, ..\, /.., \.., ./, .\, /./, \.\
45
PATH_TRAVERSAL = r"(?:^\.{2,}|\.{2,}$|\.{2,}[\/\\]|\.{1,}[\/\\]|[\/\\]\.{2,}|[\/\\]\.{1,}[\/\\])"

0 commit comments

Comments
 (0)