Add unit test for gzipped index when / is requested

This commit is contained in:
Sergio R. Caprile 2022-08-10 19:06:04 -03:00
parent 1a6bfb65e6
commit 4d9338323a
2 changed files with 4 additions and 0 deletions

Binary file not shown.

View File

@ -650,6 +650,10 @@ static void test_http_server(void) {
ASSERT(fetch(&mgr, buf, url, "GET /dredir/ HTTP/1.0\n\n") == 200);
ASSERT(cmpbody(buf, "hi\n") == 0);
ASSERT(fetch(&mgr, buf, url, "GET /dredirgz/ HTTP/1.0\n\n") == 200);
ASSERT(cmpheader(buf, "Content-Type", "text/html; charset=utf-8"));
ASSERT(cmpheader(buf, "Content-Encoding", "gzip"));
ASSERT(fetch(&mgr, buf, url, "GET /..ddot HTTP/1.0\n\n") == 301);
ASSERT(fetch(&mgr, buf, url, "GET /..ddot/ HTTP/1.0\n\n") == 200);
ASSERT(cmpbody(buf, "hi\n") == 0);