Commit 4498019 1 parent af2928d commit 4498019 Copy full SHA for 4498019
File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -745,6 +745,8 @@ void default_socket_options(socket_t sock);
745
745
746
746
const char *status_message (int status);
747
747
748
+ std::string get_bearer_token_auth (const Request &req);
749
+
748
750
namespace detail {
749
751
750
752
class MatcherBase {
@@ -1943,6 +1945,15 @@ inline const char *status_message(int status) {
1943
1945
}
1944
1946
}
1945
1947
1948
+ inline std::string get_bearer_token_auth (const Request &req) {
1949
+ if (req.has_header (" Authorization" )) {
1950
+ static std::string BearerHeaderPrefix = " Bearer " ;
1951
+ return req.get_header_value (" Authorization" )
1952
+ .substr (BearerHeaderPrefix.length ());
1953
+ }
1954
+ return " " ;
1955
+ }
1956
+
1946
1957
template <class Rep , class Period >
1947
1958
inline Server &
1948
1959
Server::set_read_timeout (const std::chrono::duration<Rep, Period> &duration) {
You can’t perform that action at this time.
0 commit comments