diff options
author | Ed Tanous <edtanous@google.com> | 2022-07-11 19:50:41 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-07-16 05:03:56 +0300 |
commit | 11ba39793c016e8476e44be880fb267e059dd4eb (patch) | |
tree | 863b07c67ed699cf051ed792b01f68c82027c94c /include/authentication.hpp | |
parent | 433b68b477a82a31de4104a83404021de1f30214 (diff) | |
download | bmcweb-11ba39793c016e8476e44be880fb267e059dd4eb.tar.xz |
Remove usages of boost::starts/ends_with
Per the coding standard, now that C++ supports std::string::starts_with
and std::string::ends_with, we should be using them over the boost
alternatives. This commit goes through and updates all usages.
Arguably some of these are incorrect, and instances of common error 13,
but because this is mostly a mechanical it intentionally doesn't try to
handle it.
Tested: Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic4c6e5d0da90f7442693199dc691a47d2240fa4f
Diffstat (limited to 'include/authentication.hpp')
-rw-r--r-- | include/authentication.hpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/authentication.hpp b/include/authentication.hpp index 8d59be406e..ac2a7d14a7 100644 --- a/include/authentication.hpp +++ b/include/authentication.hpp @@ -3,7 +3,6 @@ #include "webroutes.hpp" #include <app.hpp> -#include <boost/algorithm/string/predicate.hpp> #include <boost/container/flat_set.hpp> #include <common.hpp> #include <forward_unauthorized.hpp> @@ -42,7 +41,7 @@ static std::shared_ptr<persistent_data::UserSession> { BMCWEB_LOG_DEBUG << "[AuthMiddleware] Basic authentication"; - if (!boost::starts_with(authHeader, "Basic ")) + if (!authHeader.starts_with("Basic ")) { return nullptr; } @@ -97,7 +96,7 @@ static std::shared_ptr<persistent_data::UserSession> performTokenAuth(std::string_view authHeader) { BMCWEB_LOG_DEBUG << "[AuthMiddleware] Token authentication"; - if (!boost::starts_with(authHeader, "Token ")) + if (!authHeader.starts_with("Token ")) { return nullptr; } |