mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 15:01:03 +08:00
Merge pull request #2620 from cesanta/2617
fix wrong MIME type for custom 404
This commit is contained in:
commit
f61f2d2e9f
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user