mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
Do not reveal full root dir path
This commit is contained in:
1 parent
602c5c0866
commit
56980be48c
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -1085,7 +1085,8 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm,
|
||||
|
||||
if (realpath(t1, t2) == NULL) {
|
||||
LOG(LL_ERROR, ("realpath(%s): %d", t1, errno));
|
||||
mg_http_reply(c, 400, "", "Error serving [%s]\n", t1);
|
||||
mg_http_reply(c, 404, "", "Not found [%.*s]\n", (int) hm->uri.len,
|
||||
hm->uri.ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -665,7 +665,8 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm,
|
||||
|
||||
if (realpath(t1, t2) == NULL) {
|
||||
LOG(LL_ERROR, ("realpath(%s): %d", t1, errno));
|
||||
mg_http_reply(c, 400, "", "Error serving [%s]\n", t1);
|
||||
mg_http_reply(c, 404, "", "Not found [%.*s]\n", (int) hm->uri.len,
|
||||
hm->uri.ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user