diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-10 11:20:25 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-10 11:20:25 +0200 |
| commit | 4fa8915c8cd42b8bc30df3714e5163c4f4bece89 (patch) | |
| tree | 38c292257cd57617f1782fe9261f0367f700bf6b | |
| parent | 942559d321551e93cd6bae0b03de03e7cc13042c (diff) | |
| download | slcl-4fa8915c8cd42b8bc30df3714e5163c4f4bece89.tar.gz | |
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.
| -rw-r--r-- | page.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |
