Skip to content

Commit da0205b

Browse files
committed
Update
1 parent 3d1b5c9 commit da0205b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

httplib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7287,7 +7287,7 @@ Server::write_content_with_provider(Stream &strm, const Request &req,
72877287
inline bool Server::read_content(Stream &strm, Request &req, Response &res) {
72887288
FormFileMap::iterator cur;
72897289
Params::iterator text_cur;
7290-
bool is_text_field = false;
7290+
auto is_text_field = false;
72917291
auto file_count = 0;
72927292
if (read_content_core(
72937293
strm, req, res,

test/test.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,6 +3232,13 @@ class ServerTest : public ::testing::Test {
32323232
EXPECT_EQ("h\ne\n\nl\nl\no\n", file.content);
32333233
}
32343234

3235+
{
3236+
const auto &file = get_file_value(files, "file2");
3237+
EXPECT_EQ("world.json", file.filename);
3238+
EXPECT_EQ("application/json", file.content_type);
3239+
EXPECT_EQ(R"({\n "world": true\n}\n)", file.content);
3240+
}
3241+
32353242
{
32363243
const auto &file = get_file_value(files, "file3");
32373244
EXPECT_TRUE(file.filename.empty());
@@ -5239,7 +5246,7 @@ TEST_F(ServerTest, PostMultipartFileContentReceiver) {
52395246
{"text1", "text default", "", ""},
52405247
{"text2", "aωb", "", ""},
52415248
{"file1", "h\ne\n\nl\nl\no\n", "hello.txt", "text/plain"},
5242-
{"file2", "{\n \"world\", true\n}\n", "world.json", "application/json"},
5249+
{"file2", R"({\n "world": true\n}\n)", "world.json", "application/json"},
52435250
{"file3", "", "", "application/octet-stream"},
52445251
};
52455252

@@ -5254,7 +5261,7 @@ TEST_F(ServerTest, PostMultipartPlusBoundary) {
52545261
{"text1", "text default", "", ""},
52555262
{"text2", "aωb", "", ""},
52565263
{"file1", "h\ne\n\nl\nl\no\n", "hello.txt", "text/plain"},
5257-
{"file2", "{\n \"world\", true\n}\n", "world.json", "application/json"},
5264+
{"file2", R"({\n "world": true\n}\n)", "world.json", "application/json"},
52585265
{"file3", "", "", "application/octet-stream"},
52595266
};
52605267

0 commit comments

Comments
 (0)