mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-23 11:44:53 +00:00
check for gzipped index file when / is requested
This commit is contained in:
1 parent
79c49e64e8
commit
374be7b065
2 files changed
+8
No files matched your search
@@ -2097,6 +2097,10 @@ static int uri_to_path2(struct mg_connection *c, struct mg_http_message *hm,
|
||||
(mg_snprintf(path + n, path_size - n, "/index.shtml") > 0 &&
|
||||
(tmp = fs->st(path, NULL, NULL)) != 0))) {
|
||||
flags = tmp;
|
||||
} else if ((mg_snprintf(path + n, path_size - n, "/" MG_HTTP_INDEX ".gz") > 0 &&
|
||||
(tmp = fs->st(path, NULL, NULL)) != 0)) {
|
||||
flags = tmp;
|
||||
path[n + 1 + strlen(MG_HTTP_INDEX)] = '\0'; // Remove appended .gz
|
||||
} else {
|
||||
path[n] = '\0'; // Remove appended index file name
|
||||
}
|
||||
|
||||
@@ -675,6 +675,10 @@ static int uri_to_path2(struct mg_connection *c, struct mg_http_message *hm,
|
||||
(mg_snprintf(path + n, path_size - n, "/index.shtml") > 0 &&
|
||||
(tmp = fs->st(path, NULL, NULL)) != 0))) {
|
||||
flags = tmp;
|
||||
} else if ((mg_snprintf(path + n, path_size - n, "/" MG_HTTP_INDEX ".gz") > 0 &&
|
||||
(tmp = fs->st(path, NULL, NULL)) != 0)) { // check for gzipped index
|
||||
flags = tmp;
|
||||
path[n + 1 + strlen(MG_HTTP_INDEX)] = '\0'; // Remove appended .gz in index file name
|
||||
} else {
|
||||
path[n] = '\0'; // Remove appended index file name
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user