Merge branch 'master' of github.com:h3rald/nimhttpd
h3rald h3rald@h3rald.com
Sat, 18 Apr 2026 06:12:20 +0000
2 files changed,
6 insertions(+),
3 deletions(-)
M
src/nimhttpd.nim
→
src/nimhttpd.nim
@@ -87,10 +87,13 @@ """ % [title, style, subtitle, content, footer]
proc relativePath(path, cwd: string): string = var path2 = path - if cwd == "/": + var cwd2 = cwd + if cwd[^1] == '/' or cwd[^1] == '\\': + cwd2 = cwd[0..^2] + if cwd2 == "/": return path else: - path2.delete(0..cwd.len-1) + path2.delete(0..cwd2.len-1) var relpath = path2.replace("\\", "/") if (not relpath.endsWith("/")) and (not path.fileExists): relpath = relpath&"/"