quark

quark web server
git clone git://git.suckless.org/quark
Log | Files | Refs | LICENSE

commit 67c29aaba8a8194685677586338688e82c619e93
parent 8afc6416647585ec2695d57eee7c226216e4111c
Author: Laslo Hunhold <dev@frign.de>
Date:   Sun, 24 Jan 2021 21:38:38 +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 <dev@frign.de>

Diffstat:
Mhttp.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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;