@@ -391,10 +391,11 @@ filed_log_msg_debug("Completed locking mutex for idx: %lu", (unsigned long) cache_idx); if (strcmp(path, cache->path) != 0) { filed_log_msg_debug("Cache miss for idx: %lu: OLD \"%s\", NEW \"%s\"", (unsigned long) cache_idx, cache->path, path); + /* For requests for the root directory, serve out index.html */ if (path[0] == '\0' || (path[0] == '/' && path[1] == '\0')) { open_path = "/index.html"; } else { open_path = path; } @@ -415,11 +416,11 @@ lseek(fd, 0, SEEK_SET); cache->fd = fd; cache->len = len; cache->path = strdup(path); - cache->type = filed_determine_mimetype(path); + cache->type = filed_determine_mimetype(open_path); /* XXX:TODO: Determine */ cache->lastmod = filed_format_time(cache->lastmod_b, sizeof(cache->lastmod_b), time(NULL) - 30); } else { filed_log_msg_debug("Cache hit for idx: %lu: PATH \"%s\"", (unsigned long) cache_idx, path);