From a48abc262c843ffacd59d5a412313590e8e319f7 Mon Sep 17 00:00:00 2001 From: Benoit Favre Date: Mon, 15 Feb 2021 11:33:26 +0100 Subject: [PATCH] Fix bug in removeDotSegments when path ends with dot (#17038) [backport:1.2] (cherry picked from commit 8f54d3b792a987ae35050bf5e80063eac9821320) --- lib/pure/uri.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/uri.nim b/lib/pure/uri.nim index 264ac9f8bf..b85591bdcf 100644 --- a/lib/pure/uri.nim +++ b/lib/pure/uri.nim @@ -284,7 +284,7 @@ proc removeDotSegments(path: string): string = discard collection.pop() i.inc 3 continue - elif path[i+1] == '/': + elif i + 1 < path.len and path[i+1] == '/': i.inc 2 continue currentSegment.add path[i]