Removed unnecessary CRLF at the end of multipart ranges data

This commit is contained in:
yhirose 2023-07-29 23:01:47 -04:00
parent e699bd0730
commit 01b90829bc
2 changed files with 5 additions and 5 deletions

View file

@ -4530,7 +4530,7 @@ bool process_multipart_ranges_data(const Request &req, Response &res,
ctoken("--");
stoken(boundary);
ctoken("--\r\n");
ctoken("--");
return true;
}

View file

@ -2886,9 +2886,9 @@ TEST_F(ServerTest, GetStreamedWithRangeMultipart) {
cli_.Get("/streamed-with-range", {{make_range_header({{1, 2}, {4, 5}})}});
ASSERT_TRUE(res);
EXPECT_EQ(206, res->status);
EXPECT_EQ("269", res->get_header_value("Content-Length"));
EXPECT_EQ("267", res->get_header_value("Content-Length"));
EXPECT_EQ(false, res->has_header("Content-Range"));
EXPECT_EQ(269U, res->body.size());
EXPECT_EQ(267U, res->body.size());
}
TEST_F(ServerTest, GetStreamedEndless) {
@ -2978,9 +2978,9 @@ TEST_F(ServerTest, GetWithRangeMultipart) {
auto res = cli_.Get("/with-range", {{make_range_header({{1, 2}, {4, 5}})}});
ASSERT_TRUE(res);
EXPECT_EQ(206, res->status);
EXPECT_EQ("269", res->get_header_value("Content-Length"));
EXPECT_EQ("267", res->get_header_value("Content-Length"));
EXPECT_EQ(false, res->has_header("Content-Range"));
EXPECT_EQ(269U, res->body.size());
EXPECT_EQ(267U, res->body.size());
}
TEST_F(ServerTest, GetWithRangeMultipartOffsetGreaterThanContent) {