Code format

This commit is contained in:
yhirose 2023-12-17 22:00:33 -05:00
parent cddaedaff8
commit f1dec77f46
2 changed files with 8 additions and 11 deletions

View file

@ -1994,7 +1994,6 @@ void split(const char *b, const char *e, char d,
void split(const char *b, const char *e, char d, size_t m,
std::function<void(const char *, const char *)> fn);
bool process_client_socket(socket_t sock, time_t read_timeout_sec,
time_t read_timeout_usec, time_t write_timeout_sec,
time_t write_timeout_usec,
@ -5824,8 +5823,8 @@ inline bool Server::parse_request_line(const char *s, Request &req) const {
size_t count = 0;
detail::split(req.target.data(), req.target.data() + req.target.size(), '?', 2,
[&](const char *b, const char *e) {
detail::split(req.target.data(), req.target.data() + req.target.size(), '?',
2, [&](const char *b, const char *e) {
switch (count) {
case 0:
req.path = detail::decode_url(std::string(b, e), false);

View file

@ -1848,7 +1848,7 @@ protected:
});
})
.Get("/regex-with-delimiter",
[&](const Request & req, Response &res) {
[&](const Request &req, Response & /*res*/) {
ASSERT_TRUE(req.has_param("key"));
EXPECT_EQ("^(?.*(value))", req.get_param_value("key"));
})
@ -3357,14 +3357,12 @@ TEST_F(ServerTest, GetStreamedChunkedWithGzip2) {
EXPECT_EQ(std::string("123456789"), res->body);
}
TEST_F(ServerTest, SplitDelimiterInPathRegex) {
auto res = cli_.Get("/regex-with-delimiter?key=^(?.*(value))");
ASSERT_TRUE(res);
EXPECT_EQ(200, res->status);
}
TEST(GzipDecompressor, ChunkedDecompression) {
std::string data;
for (size_t i = 0; i < 32 * 1024; ++i) {