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

Request sni hostname#787

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
Merged
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
Test only if https enabled
  • Loading branch information
@maingoh
maingoh committedOct 19, 2017
commit70ea80eaa92df1c772e510a03f923bf63e84f324
44 changes: 20 additions & 24 deletionslibs/network/test/http/client_get_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,30 +46,6 @@ TYPED_TEST(HTTPClientTest, GetHTTPSTest) {
}
}

#endif

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));
auto range = headers(response);
ASSERT_TRUE(!boost::empty(range));
try {
auto data = body(response);
std::cout << data;
} catch (...) {
FAIL() << "Caught exception while retrieving body from GET request";
}
EXPECT_EQ("HTTP/1.", response.version().substr(0, 7));
EXPECT_TRUE(response.status() == 200u ||
(response.status() >= 300 && response.status() < 400));
}


typedef boost::network::http::basic_client<boost::network::http::tags::http_async_8bit_tcp_resolve, 1, 1> async_client;
#define EXC_PTR(cmd) try { cmd } catch (const std::exception_ptr& ex) { std::rethrow_exception(ex); }

TYPED_TEST(HTTPClientTest, GetRequestSNI) {
using client = TypeParam;
// need sni_hostname to be set
Expand All@@ -94,3 +70,23 @@ TYPED_TEST(HTTPClientTest, GetRequestSNI) {
}

}

#endif

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));
auto range = headers(response);
ASSERT_TRUE(!boost::empty(range));
try {
auto data = body(response);
std::cout << data;
} catch (...) {
FAIL() << "Caught exception while retrieving body from GET request";
}
EXPECT_EQ("HTTP/1.", response.version().substr(0, 7));
EXPECT_TRUE(response.status() == 200u ||
(response.status() >= 300 && response.status() < 400));
}

[8]ページ先頭

©2009-2025 Movatter.jp