mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-09 16:21:45 +00:00
fix wrong MIME type for custom 404
This commit is contained in:
1 parent
93148e3223
commit
1c114a279e
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
|
// Failed to open, and page404 is configured? Open it, then
|
||||||
if (fd == NULL && opts->page404 != NULL) {
|
if (fd == NULL && opts->page404 != NULL) {
|
||||||
fd = mg_fs_open(fs, opts->page404, MG_FS_READ);
|
fd = mg_fs_open(fs, opts->page404, MG_FS_READ);
|
||||||
mime = guess_content_type(mg_str(path), opts->mime_types);
|
|
||||||
path = opts->page404;
|
path = opts->page404;
|
||||||
|
mime = guess_content_type(mg_str(path), opts->mime_types);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd == NULL || fs->st(path, &size, &mtime) == 0) {
|
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
|
// Failed to open, and page404 is configured? Open it, then
|
||||||
if (fd == NULL && opts->page404 != NULL) {
|
if (fd == NULL && opts->page404 != NULL) {
|
||||||
fd = mg_fs_open(fs, opts->page404, MG_FS_READ);
|
fd = mg_fs_open(fs, opts->page404, MG_FS_READ);
|
||||||
mime = guess_content_type(mg_str(path), opts->mime_types);
|
|
||||||
path = opts->page404;
|
path = opts->page404;
|
||||||
|
mime = guess_content_type(mg_str(path), opts->mime_types);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd == NULL || fs->st(path, &size, &mtime) == 0) {
|
if (fd == NULL || fs->st(path, &size, &mtime) == 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user