GeezerVison is showing github.com — unit test faild,because of "http://www.boost.org" return "301 Moved Permanently" · Issue #836 · cpp-netlib/cpp-netlib
unit test faild,because of "http://www.boost.org" return "301 Moved Permanently" #836
Description
OS: CentOS7.4 x64
gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
boost 1.66
cpp-netlib:0.12.0-final
tests]$ ./cpp-netlib-http-client_get_streaming_test
cpp-netlib-0.12.0-final/libs/network/test/http/client_get_streaming_test.cpp:41: Failure
Expected: 200u
Which is: 200
To be equal to: response.status()
Which is: 301
/home/limenghua/Downloads/cpp-netlib-0.12.0-final/libs/network/test/http/client_get_streaming_test.cpp:42: Failure
Expected: "OK"
To be equal to: response.status_message()
Which is: "Moved Permanently"
Activity
umennel commented on May 3, 2018
Hi @limenghua, in the 0.13 release, we used to connect to boost.org in some of the tests because the site would support chunked transfer encoding. But now they don't allow unencrypted connections any more. We need to find another source for testing chunked transfer encoding. But since you are using the 0.12 release, chunked transfer encoding is not available anyway, so I guess any site allowing unencrypted connections will do.
deanberris commented on May 8, 2018
Yeah, this one's tricky -- we definitely should update the test to either:
-
Use HTTPS and chunked transfer encoding.
-
Set up our own server to make HTTP requests to.
While I'm not a great fan of solution 2, that might be the easiest thing to do in this case.
yhager commented on May 14, 2018
The test passes for me on 0.13-release branch if I change http to https:
--- a/libs/network/test/http/client_get_streaming_test.cpp
+++ b/libs/network/test/http/client_get_streaming_test.cpp
@@ -26,7 +26,7 @@ struct body_handler {
TYPED_TEST_CASE(HTTPClientTest, ClientTypes);
TYPED_TEST(HTTPClientTest, GetStreamingTest) {
- typename TypeParam::request request("http://www.boost.org");
+ typename TypeParam::request request("https://www.boost.org");
typename TypeParam::response response;
typename TypeParam::string_type body_string;
typename TypeParam::string_type dummy_body;deanberris commented on May 15, 2018
Cool -- can you send a pull request with that change @yhager?
Metadata
Metadata
Development
No branches or pull requestsIssue actions