From 4fa8915c8cd42b8bc30df3714e5163c4f4bece89 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 10 Oct 2025 11:20:25 +0200 Subject: page.c: Ensure trailing '/' on dir download URLs Otherwise, it is not ensured web browsers would translate a relative directory such as "dir/.." to a URL with a trailing '/'. Therefore, a POST request to "/user?download=1" would fail because slcl only considers "/user/" (note the trailing '/') as valid. --- page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/page.c b/page.c index 237a791..5a34c22 100644 --- a/page.c +++ b/page.c @@ -416,7 +416,7 @@ static int prepare_download(struct html_node *const n, { dynstr_free(&d); - if (dynstr_append(&d, "%s?download=1", encurl)) + if (dynstr_append(&d, "%s/?download=1", encurl)) { fprintf(stderr, "%s: dynstr_append encurl dir failed\n", __func__); goto end; -- cgit v1.2.3