1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

HTTP: Only enable infinite chunked for HTTP_REQUEST

This commit is contained in:
winlin 2020-07-03 17:05:01 +08:00
parent 2008aa1a99
commit 671af4369b
4 changed files with 27 additions and 19 deletions

View file

@ -991,7 +991,7 @@ VOID TEST(ProtocolHTTPTest, HTTPServerMuxerCORS)
MockResponseWriter w;
SrsHttpMessage r(NULL, NULL);
r.set_basic(HTTP_POST, 200, -1);
r.set_basic(HTTP_REQUEST, HTTP_POST, 200, -1);
HELPER_ASSERT_SUCCESS(r.set_url("/index.html", false));
SrsHttpCorsMux cs;
@ -1011,7 +1011,7 @@ VOID TEST(ProtocolHTTPTest, HTTPServerMuxerCORS)
MockResponseWriter w;
SrsHttpMessage r(NULL, NULL);
r.set_basic(HTTP_OPTIONS, 200, -1);
r.set_basic(HTTP_REQUEST, HTTP_OPTIONS, 200, -1);
HELPER_ASSERT_SUCCESS(r.set_url("/index.html", false));
SrsHttpCorsMux cs;
@ -1031,7 +1031,7 @@ VOID TEST(ProtocolHTTPTest, HTTPServerMuxerCORS)
MockResponseWriter w;
SrsHttpMessage r(NULL, NULL);
r.set_basic(HTTP_POST, 200, -1);
r.set_basic(HTTP_REQUEST, HTTP_POST, 200, -1);
HELPER_ASSERT_SUCCESS(r.set_url("/index.html", false));
SrsHttpCorsMux cs;
@ -1051,7 +1051,7 @@ VOID TEST(ProtocolHTTPTest, HTTPServerMuxerCORS)
MockResponseWriter w;
SrsHttpMessage r(NULL, NULL);
r.set_basic(HTTP_OPTIONS, 200, -1);
r.set_basic(HTTP_REQUEST, HTTP_OPTIONS, 200, -1);
HELPER_ASSERT_SUCCESS(r.set_url("/index.html", false));
SrsHttpCorsMux cs;
@ -1662,7 +1662,7 @@ VOID TEST(ProtocolHTTPTest, HTTPMessageUpdate)
SrsHttpMessage m;
m.set_header(&h, false);
m.set_basic(HTTP_POST, 200, 2);
m.set_basic(HTTP_REQUEST, HTTP_POST, 200, 2);
EXPECT_EQ(10, m.content_length());
}
@ -1672,7 +1672,7 @@ VOID TEST(ProtocolHTTPTest, HTTPMessageUpdate)
h.set("Content-Length", "10");
SrsHttpMessage m;
m.set_basic(HTTP_POST, 200, 2);
m.set_basic(HTTP_REQUEST, HTTP_POST, 200, 2);
m.set_header(&h, false);
EXPECT_EQ(10, m.content_length());
}
@ -1706,7 +1706,7 @@ VOID TEST(ProtocolHTTPTest, HTTPMessageUpdate)
if (true) {
SrsHttpMessage m;
m.set_basic(HTTP_POST, 200, 0);
m.set_basic(HTTP_REQUEST, HTTP_POST, 200, 0);
EXPECT_EQ(0, m.content_length());
}