Add slash to href for directories (#17)

This allows client side parsers to decide when a link is a directory.

This is needed for example in the rclone http backend.

https://rclone.org/http/
This commit is contained in:
Daniel Nagy 2022-02-09 01:43:03 +01:00 committed by GitHub
parent 3641c2f50f
commit a981031e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1987,6 +1987,8 @@ static void generate_dir_listing(struct connection *conn, const char *path,
append(listing, "<a href=\"");
append(listing, safe_url);
if (list[i]->is_dir)
append(listing, "/");
append(listing, "\">");
append_escaped(listing, list[i]->name);
append(listing, "</a>");