commit a4ea7cbe676adffd1dbd98b2bb7f68591b24d46c
Author:     Laslo Hunhold <[email protected]>
AuthorDate: Sun Jan 24 21:14:13 2021 +0100
Commit:     Laslo Hunhold <[email protected]>
CommitDate: Sun Jan 24 21:14:13 2021 +0100

    Revert "Fix directory-index-handling"
    
    This reverts commit 87ae2e9212c5cc7309eefa2a3f49a758862db6c7, which
    did three things at once and lacked proper git-author-attribution for
    Quentin for the underlying change.
    
    I have read too many OpenBSD-CVS-logs where this is common, but only
    due to the fact that CSV doesn't distinguish between author and
    committer, which leads to an antipattern in git.

diff --git a/http.c b/http.c
index c11e367..dc32290 100644
--- a/http.c
+++ b/http.c
@@ -760,13 +760,6 @@ http_prepare_response(const struct request *req, struct 
response *res,
                                    S_FORBIDDEN : S_NOT_FOUND;
                                goto err;
                        }
-               } else {
-                       /* docindex is valid, write tmpuri to response-path */
-                       if (esnprintf(res->path, sizeof(res->path), "%s",
-                                     tmpuri)) {
-                               s = S_REQUEST_TOO_LARGE;
-                               goto err;
-                       }
                }
        }
 
@@ -807,7 +800,7 @@ http_prepare_response(const struct request *req, struct 
response *res,
 
        /* mime */
        mime = "application/octet-stream";
-       if ((p = strrchr(res->path, '.'))) {
+       if ((p = strrchr(realuri, '.'))) {
                for (i = 0; i < LEN(mimes); i++) {
                        if (!strcmp(mimes[i].ext, p + 1)) {
                                mime = mimes[i].type;

Reply via email to