all repos — nimhttpd @ f5204e05db638238b7bc002f1bcd48f36815a581

A useful static file web server.

Merge branch 'master' of github.com:h3rald/nimhttpd
h3rald h3rald@h3rald.com
Sat, 18 Apr 2026 06:12:20 +0000
commit

f5204e05db638238b7bc002f1bcd48f36815a581

parent

caaff4f99f052ad70b142883db0624f1ae4e24a0

2 files changed, 6 insertions(+), 3 deletions(-)

jump to
M buildbuild

@@ -1,1 +1,1 @@

-nimble build -d:release --gc:orc --opt:size --verbose +nimble build -d:release --mm:orc --opt:size --verbose
M src/nimhttpd.nimsrc/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&"/"