Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Introduced new chunked transfer encoding parser to remove chunk markers#720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deanberris merged 7 commits intocpp-netlib:masterfromumennel:master-integration
Mar 31, 2017
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Applied new remove chunk markers option to tests.
  • Loading branch information
@umennel
umennel committedDec 14, 2016
commitc4d758a6855f5b669a210a0be4c4d85e07b96427
9 changes: 6 additions & 3 deletionslibs/network/test/http/client_get_different_port_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,9 +15,12 @@ namespace http = boost::network::http;
TYPED_TEST_CASE(HTTPClientTest, ClientTypes);

TYPED_TEST(HTTPClientTest, GetDifferentPort) {
TypeParam client;
typename TypeParam::requestr("http://www.boost.org:80/");
auto response_ = client.get(r);
using client = TypeParam;
typename client::options options;
options.remove_chunk_markers(true);
client client_;
typename TypeParam::requestrequest("http://www.boost.org:80/");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I know this might be out-of-scope, but could you make this point tocpp-netlib.org instead? That would be great, thanks. :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Unfortunately cpp-netlib.org does not yield chunk encoded content. It does not matter much for this particular test, but for the streaming test we'd have all scenarios covered withwww.boost.org: it yields chunk encoded content for http/1.1 clients and non encoded content for http/1.0 clients.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah, good point, thanks.

auto response_ = client_.get(request);
auto range =headers(response_)["Content-Type"];
EXPECT_TRUE(std::begin(range) !=std::end(range));
EXPECT_NE(0,body(response_).size());
Expand Down
5 changes: 4 additions & 1 deletionlibs/network/test/http/client_get_streaming_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,7 +32,10 @@ TYPED_TEST(HTTPClientTest, GetStreamingTest) {
typename TypeParam::string_type dummy_body;
body_handler handler_instance(body_string);
{
TypeParam client_;
using client = TypeParam;
typename client::options options;
options.remove_chunk_markers(true);
client client_(options);
ASSERT_NO_THROW(response = client_.get(request, handler_instance));
auto range = headers(response)["Content-Type"];
ASSERT_TRUE(!boost::empty(range));
Expand Down
12 changes: 9 additions & 3 deletionslibs/network/test/http/client_get_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,9 @@ TYPED_TEST_CASE(HTTPClientTest, ClientTypes);
TYPED_TEST(HTTPClientTest, GetTest) {
using client = TypeParam;
typename client::request request("http://cpp-netlib.org/");
client client_;
typename client::options options;
options.remove_chunk_markers(true);
client client_(options);
typename client::response response;
ASSERT_NO_THROW(response = client_.get(request));
try {
Expand All@@ -34,7 +36,9 @@ TYPED_TEST(HTTPClientTest, GetTest) {
TYPED_TEST(HTTPClientTest, GetHTTPSTest) {
using client = TypeParam;
typename client::request request("https://www.github.com/");
client client_;
typename client::options options;
options.remove_chunk_markers(true);
client client_(options);
typename client::response response = client_.get(request);
EXPECT_TRUE(response.status() == 200 ||
(response.status() >= 300 && response.status() < 400));
Expand All@@ -52,7 +56,9 @@ TYPED_TEST(HTTPClientTest, TemporaryClientObjectTest) {
using client = TypeParam;
typename client::request request("http://cpp-netlib.org/");
typename client::response response;
ASSERT_NO_THROW(response = client().get(request));
typename client::options options;
options.remove_chunk_markers(true);
ASSERT_NO_THROW(response = client(options).get(request));
auto range = headers(response);
ASSERT_TRUE(!boost::empty(range));
try {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp