mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-11 17:04:33 +07:00
Add SSI include file=, include virtual=
This commit is contained in:
@@ -0,0 +1 @@
|
||||
this is f1
|
||||
@@ -0,0 +1,3 @@
|
||||
this is index
|
||||
<!--#include file="nested.shtml" -->
|
||||
<!--#include file="recurse.shtml" -->
|
||||
@@ -0,0 +1,3 @@
|
||||
this is nested
|
||||
<!--#include virtual="/notexist.txt"-->
|
||||
<!--#include virtual="/ssi/f1.txt"-->
|
||||
@@ -0,0 +1,2 @@
|
||||
<!--#include file="recurse.shtml"-->
|
||||
recurse
|
||||
+12
-1
@@ -349,7 +349,7 @@ static void eh1(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
struct mg_http_serve_opts opts = {".", NULL};
|
||||
mg_http_serve_dir(c, hm, &opts);
|
||||
} else {
|
||||
struct mg_http_serve_opts opts = {"./test/data", NULL};
|
||||
struct mg_http_serve_opts opts = {"./test/data", "#.shtml"};
|
||||
mg_http_serve_dir(c, hm, &opts);
|
||||
}
|
||||
} else if (ev == MG_EV_WS_MSG) {
|
||||
@@ -477,6 +477,17 @@ static void test_http_server(void) {
|
||||
"Content-Length: 4\r\n\r\nkuku") == 200);
|
||||
ASSERT(cmpbody(buf, "kuku") == 0);
|
||||
|
||||
ASSERT(fetch(&mgr, buf, url, "GET /ssi HTTP/1.1\r\n\r\n") == 200);
|
||||
ASSERT(cmpbody(buf,
|
||||
"this is index\n"
|
||||
"this is nested\n\n"
|
||||
"this is f1\n\n\n\n"
|
||||
"recurse\n\n"
|
||||
"recurse\n\n"
|
||||
"recurse\n\n"
|
||||
"recurse\n\n"
|
||||
"recurse\n\n") == 0);
|
||||
|
||||
ASSERT(fetch(&mgr, buf, url, "GET /badroot HTTP/1.0\r\n\n") == 400);
|
||||
#if MG_ARCH == MG_ARCH_WIN32
|
||||
ASSERT(cmpbody(buf, "Bad web root [Z:\\BAAADDD!]\n") == 0);
|
||||
|
||||
Reference in New Issue
Block a user