This commit is contained in:
parent
0dd284267a
commit
28832f8732
@ -148,6 +148,7 @@ namespace ix
|
|||||||
content = gzipCompress(content);
|
content = gzipCompress(content);
|
||||||
headers["Content-Encoding"] = "gzip";
|
headers["Content-Encoding"] = "gzip";
|
||||||
}
|
}
|
||||||
|
headers["Accept-Encoding"] = "gzip";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Log request
|
// Log request
|
||||||
@ -161,11 +162,6 @@ namespace ix
|
|||||||
// headers["Content-Type"] = "application/octet-stream";
|
// headers["Content-Type"] = "application/octet-stream";
|
||||||
headers["Accept-Ranges"] = "none";
|
headers["Accept-Ranges"] = "none";
|
||||||
|
|
||||||
for (auto&& it : request->headers)
|
|
||||||
{
|
|
||||||
headers[it.first] = it.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::make_shared<HttpResponse>(
|
return std::make_shared<HttpResponse>(
|
||||||
200, "OK", HttpErrorCode::Ok, headers, content);
|
200, "OK", HttpErrorCode::Ok, headers, content);
|
||||||
});
|
});
|
||||||
|
@ -60,6 +60,7 @@ TEST_CASE("http server", "[httpd]")
|
|||||||
REQUIRE(response->errorCode == HttpErrorCode::Ok);
|
REQUIRE(response->errorCode == HttpErrorCode::Ok);
|
||||||
REQUIRE(response->statusCode == 200);
|
REQUIRE(response->statusCode == 200);
|
||||||
REQUIRE(response->headers["Accept-Encoding"] == "gzip");
|
REQUIRE(response->headers["Accept-Encoding"] == "gzip");
|
||||||
|
REQUIRE(response->headers["Content-Encoding"] == "gzip");
|
||||||
|
|
||||||
server.stop();
|
server.stop();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user