From a1c099c9f5caed39090dbaf0a88e25bc08b101c9 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Tue, 13 Dec 2011 04:01:38 +0100 Subject: [PATCH] sendfile: Use the header X-Ash-Content-Type for file's MIME type, if given. --- src/sendfile.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sendfile.c b/src/sendfile.c index 81fb67a..85ea9bb 100644 --- a/src/sendfile.c +++ b/src/sendfile.c @@ -279,8 +279,12 @@ int main(int argc, char **argv) simpleerror(1, 405, "Method not allowed", "The requested method is not defined for this resource."); return(0); } - if(contype == NULL) - contype = getmimetype(file, &sb); + if(contype == NULL) { + if((hdr = getenv("REQ_X_ASH_CONTENT_TYPE")) != NULL) + contype = hdr; + else + contype = getmimetype(file, &sb); + } contype = ckctype(contype); checkcache(file, &sb); -- 2.11.0