mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-24 11:54:49 +00:00
More explicit check on hm->uri.len
This commit is contained in:
1 parent
86c70e5abb
commit
3329047579
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -1478,7 +1478,7 @@ static int uri_to_path2(struct mg_connection *c, struct mg_http_message *hm,
|
||||
flags = fs->stat(path, NULL, NULL); // Does it exist?
|
||||
if (flags == 0) {
|
||||
mg_http_reply(c, 404, "", "Not found\n"); // Does not exist, doh
|
||||
} else if ((flags & MG_FS_DIR) && hm->uri.len &&
|
||||
} else if ((flags & MG_FS_DIR) && hm->uri.len > 0 &&
|
||||
hm->uri.ptr[hm->uri.len - 1] != '/') {
|
||||
mg_printf(c,
|
||||
"HTTP/1.1 301 Moved\r\n"
|
||||
|
||||
+1
-1
@@ -732,7 +732,7 @@ static int uri_to_path2(struct mg_connection *c, struct mg_http_message *hm,
|
||||
flags = fs->stat(path, NULL, NULL); // Does it exist?
|
||||
if (flags == 0) {
|
||||
mg_http_reply(c, 404, "", "Not found\n"); // Does not exist, doh
|
||||
} else if ((flags & MG_FS_DIR) && hm->uri.len &&
|
||||
} else if ((flags & MG_FS_DIR) && hm->uri.len > 0 &&
|
||||
hm->uri.ptr[hm->uri.len - 1] != '/') {
|
||||
mg_printf(c,
|
||||
"HTTP/1.1 301 Moved\r\n"
|
||||
|
||||
Reference in new issue
Block a user