mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-01 13:10:43 +00:00
Fix #1560 - implement precompressed .gz file serving
This commit is contained in:
1 parent
9ffb6fb26a
commit
fe682f8399
3 files changed
+64
-20
No files matched your search
@@ -812,6 +812,16 @@ static void test_http_server(void) {
|
||||
ASSERT(fetch(&mgr, buf, url, "GET /a.txt HTTP/1.0\n\n") == 200);
|
||||
ASSERT(fetch(&mgr, buf, url, "HEAD /a.txt HTTP/1.0\n\n") == 200);
|
||||
|
||||
// Pre-compressed files
|
||||
{
|
||||
struct mg_http_message hm;
|
||||
ASSERT(fetch(&mgr, buf, url, "HEAD /hello.txt HTTP/1.0\n\n") == 200);
|
||||
mg_http_parse(buf, strlen(buf), &hm);
|
||||
ASSERT(mg_http_get_header(&hm, "Content-Encoding") != NULL);
|
||||
ASSERT(mg_strcmp(*mg_http_get_header(&hm, "Content-Encoding"),
|
||||
mg_str("gzip")) == 0);
|
||||
}
|
||||
|
||||
#if MG_ENABLE_IPV6
|
||||
{
|
||||
const char *url6 = "http://[::1]:12366";
|
||||
|
||||
Reference in new issue
Block a user