mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-13 10:15:00 +00:00
Merge pull request #2620 from cesanta/2617
fix wrong MIME type for custom 404
This commit is contained in:
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -2787,8 +2787,8 @@ void mg_http_serve_file(struct mg_connection *c, struct mg_http_message *hm,
|
||||
// Failed to open, and page404 is configured? Open it, then
|
||||
if (fd == NULL && opts->page404 != NULL) {
|
||||
fd = mg_fs_open(fs, opts->page404, MG_FS_READ);
|
||||
mime = guess_content_type(mg_str(path), opts->mime_types);
|
||||
path = opts->page404;
|
||||
mime = guess_content_type(mg_str(path), opts->mime_types);
|
||||
}
|
||||
|
||||
if (fd == NULL || fs->st(path, &size, &mtime) == 0) {
|
||||
|
||||
+1
-1
@@ -571,8 +571,8 @@ void mg_http_serve_file(struct mg_connection *c, struct mg_http_message *hm,
|
||||
// Failed to open, and page404 is configured? Open it, then
|
||||
if (fd == NULL && opts->page404 != NULL) {
|
||||
fd = mg_fs_open(fs, opts->page404, MG_FS_READ);
|
||||
mime = guess_content_type(mg_str(path), opts->mime_types);
|
||||
path = opts->page404;
|
||||
mime = guess_content_type(mg_str(path), opts->mime_types);
|
||||
}
|
||||
|
||||
if (fd == NULL || fs->st(path, &size, &mtime) == 0) {
|
||||
|
||||
Reference in new issue
Block a user