summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorBenoit Favre <benoit.favre@gmail.com>2021-02-15 11:33:26 +0100
committerGitHub <noreply@github.com>2021-02-15 11:33:26 +0100
commit8f54d3b792a987ae35050bf5e80063eac9821320 (patch)
tree3a4060e07c3102a9baf2bddc61573ea11ba3da8a /lib/pure
parent240879bf3d746059accd73deacc7405c53aa0704 (diff)
downloadNim-8f54d3b792a987ae35050bf5e80063eac9821320.tar.gz
Fix bug in removeDotSegments when path ends with dot (#17038) [backport:1.2]
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/uri.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/uri.nim b/lib/pure/uri.nim
index e2b44a018..4b25ba084 100644
--- a/lib/pure/uri.nim
+++ b/lib/pure/uri.nim
@@ -355,7 +355,7 @@ func 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]