@@ -448,6 +448,39 @@ TEST_FIXTURE(uri_address, test_leaks)
448
448
listener.close ().wait ();
449
449
}
450
450
451
+ TEST_FIXTURE (uri_address, http_version)
452
+ {
453
+ http_listener listener (U (" http://localhost:45678/path1" ));
454
+ listener.open ().wait ();
455
+
456
+ test_http_client::scoped_client client (U (" http://localhost:45678" ));
457
+ test_http_client * p_client = client.client ();
458
+
459
+ volatile unsigned long requestCount = 0 ;
460
+
461
+ listener.support (methods::GET, [&requestCount](http_request request)
462
+ {
463
+ const auto & httpVersion = request.http_version ();
464
+
465
+ // All clients currently use HTTP/1.1
466
+ VERIFY_IS_TRUE (httpVersion == http_versions::HTTP_1_1);
467
+
468
+ os_utilities::interlocked_increment (&requestCount);
469
+ request.reply (status_codes::NoContent);
470
+ });
471
+
472
+ // Send a request to the listener
473
+ VERIFY_ARE_EQUAL (0 , p_client->request (methods::GET, U (" /path1" )));
474
+
475
+ p_client->next_response ().then ([](test_response *p_response)
476
+ {
477
+ http_asserts::assert_test_response_equals (p_response, status_codes::NoContent);
478
+ }).wait ();
479
+
480
+ VERIFY_IS_TRUE (requestCount >= 1 );
481
+ listener.close ().wait ();
482
+ }
483
+
451
484
TEST_FIXTURE (uri_address, remote_address)
452
485
{
453
486
http_listener listener (U (" http://localhost:45678/path1" ));
0 commit comments