File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ namespace burl
1919{
2020namespace detail
2121{
22-
22+ # if 0
2323namespace grammar = boost::urls::grammar;
2424namespace variant2 = boost::variant2;
2525namespace fs = std::filesystem;
@@ -169,7 +169,7 @@ resolve_dest(response& resp, fs::path dest)
169169
170170 return dest / "index.html";
171171}
172-
172+ # endif
173173} // namespace detail
174174} // namespace burl
175175} // namespace boost
Original file line number Diff line number Diff line change 3737 return static_cast <std::size_t >(x);
3838}
3939
40+ #if 0
41+
4042std::optional<std::string>
4143extract_filename_form_content_disposition(std::string_view sv);
4244
@@ -47,6 +49,7 @@ extract_filename_form_content_disposition(std::string_view sv);
4749std::filesystem::path
4850resolve_dest(response& resp, std::filesystem::path dest);
4951
52+ #endif
5053} // namespace detail
5154} // namespace burl
5255} // namespace boost
Original file line number Diff line number Diff line change @@ -972,6 +972,32 @@ class client_test
972972 http::method::options);
973973 }
974974
975+ void
976+ testBasicAuth ()
977+ {
978+ client c (
979+ capy::get_system_context ().get_executor (),
980+ corosio::tls_context ());
981+
982+ c.basic_auth (" user" , " pass" );
983+ BOOST_TEST_EQ (
984+ c.headers ().at (http::field::authorization),
985+ " Basic dXNlcjpwYXNz" );
986+ }
987+
988+ void
989+ testBearerAuth ()
990+ {
991+ client c (
992+ capy::get_system_context ().get_executor (),
993+ corosio::tls_context ());
994+
995+ c.bearer_auth (" sekrit" );
996+ BOOST_TEST_EQ (
997+ c.headers ().at (http::field::authorization),
998+ " Bearer sekrit" );
999+ }
1000+
9751001 void
9761002 run ()
9771003 {
@@ -999,6 +1025,8 @@ class client_test
9991025 testStatusErrorThenTransportErrorOnBody ();
10001026 testTransportErrorInjection ();
10011027 testVerbs ();
1028+ testBasicAuth ();
1029+ testBearerAuth ();
10021030 }
10031031};
10041032
Original file line number Diff line number Diff line change @@ -25,34 +25,21 @@ struct error_test
2525 void
2626 testCategoryNames ()
2727 {
28- BOOST_TEST (std::string (burl_category ().name ()) == " boost.burl" );
29- BOOST_TEST (
30- std::string (burl_condition_category ().name ()) ==
28+ BOOST_TEST_EQ (
29+ std::string_view{ burl_category ().name () },
30+ " boost.burl" );
31+ BOOST_TEST_EQ (
32+ std::string_view{ burl_condition_category ().name () },
3133 " boost.burl.condition" );
3234 }
3335
3436 void
3537 testMessages ()
3638 {
37- BOOST_TEST_EQ (
38- make_error_code (error::unsupported_url_scheme).message (),
39- " unsupported URL scheme" );
40- BOOST_TEST_EQ (
41- make_error_code (error::too_many_redirects).message (),
42- " too many redirects" );
43- BOOST_TEST_EQ (
44- make_error_code (error::bad_redirect_response).message (),
45- " bad redirect response" );
46- BOOST_TEST_EQ (
47- make_error_code (error::file_changed).message (),
48- " file size changed during read" );
49- BOOST_TEST_EQ (
50- make_error_code (error::proxy_auth_failed).message (),
51- " proxy authentication failed" );
52-
5339 // The code carries the burl category.
5440 BOOST_TEST_EQ (
55- &make_error_code (error::file_changed).category (), &burl_category ());
41+ &make_error_code (error::file_changed).category (),
42+ &burl_category ());
5643 }
5744
5845 void
You can’t perform that action at this time.
0 commit comments