From 2557ca7665bdb113fcaa35eb70adbe2eaba1f157 Mon Sep 17 00:00:00 2001 From: apapacy Date: Mon, 11 May 2026 16:21:52 +0300 Subject: [PATCH] with leading slash join always return LocalPath value --- src/nova_router.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nova_router.erl b/src/nova_router.erl index e95d07a..6713d29 100644 --- a/src/nova_router.erl +++ b/src/nova_router.erl @@ -292,7 +292,7 @@ parse_url(Host, [{RemotePath, LocalPath}|Tl], T, Value = #nova_handler_value{}, parse_url(Host, [{RemotePath, LocalPath, Options}|Tl], T = #{prefix := Prefix}, Value = #nova_handler_value{app = App, secure = Secure}, Tree) when is_list(RemotePath), is_list(LocalPath) -> %% Static assets - check that the path exists - PrivPath = filename:join(code:priv_dir(App), LocalPath), + PrivPath = filename:join(code:priv_dir(App), string:trim(LocalPath, leading, "/")), Payload = case {filelib:is_dir(LocalPath), filelib:is_dir(PrivPath)} of