Merge pull request #1670 from cesanta/index.gx-test

Add unit test for gzipped index when / is requested
This commit is contained in:
Sergey Lyubka 2022-08-10 23:46:08 +01:00 committed by GitHub
commit 44a0fa0986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);