diff --git a/docs/README.md b/docs/README.md index 72c058e9..cc794b76 100644 --- a/docs/README.md +++ b/docs/README.md @@ -912,6 +912,10 @@ void mg_http_serve_dir(struct mg_connection *c, struct mg_http_message *hm, Serve static files according to the given options. Note that in order to enable SSI, set a `-DMG_ENABLE_SSI=1` build flag. +NOTE: Avoid double dots `..` in +the `root_dir`. If you need to +reference an upper-level directory, use absolute path. + Parameters: - `c` - Connection to use - `hm` - HTTP message, that should be served diff --git a/examples/http-server/main.c b/examples/http-server/main.c index 7b03f5e3..7c1d7d27 100644 --- a/examples/http-server/main.c +++ b/examples/http-server/main.c @@ -5,7 +5,7 @@ #include "mongoose.h" static const char *s_debug_level = "2"; -static const char *s_root_dir = "."; +static const char *s_root_dir = "."; // Attention: avoid double-dots, `..` ! static const char *s_listening_address = "http://localhost:8000"; static const char *s_enable_hexdump = "no";