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