commit 67c29aaba8a8194685677586338688e82c619e93
Author:     Laslo Hunhold <[email protected]>
AuthorDate: Sun Jan 24 21:38:38 2021 +0100
Commit:     Laslo Hunhold <[email protected]>
CommitDate: Sun Jan 24 21:38:38 2021 +0100

    Make sure the docindex' mime-type is determined correctly
    
    Previously, the docindex would always be served with the default
    mime-type, given the directory-URI does not have a file extension.
    
    Signed-off-by: Laslo Hunhold <[email protected]>

diff --git a/http.c b/http.c
index f1e63a4..b74c61d 100644
--- a/http.c
+++ b/http.c
@@ -806,7 +806,7 @@ http_prepare_response(const struct request *req, struct 
response *res,
 
        /* mime */
        mime = "application/octet-stream";
-       if ((p = strrchr(realuri, '.'))) {
+       if ((p = strrchr(res->path, '.'))) {
                for (i = 0; i < LEN(mimes); i++) {
                        if (!strcmp(mimes[i].ext, p + 1)) {
                                mime = mimes[i].type;

Reply via email to