MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / HttpParseBearerToken

Function HttpParseBearerToken

Libraries/Http/HttpHeaders.cpp:565–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563bool HttpAuthorizationView::isBasic() const { return HttpHeaderInternal::equalsIgnoreCase(scheme, "Basic"); }
564
565Result HttpParseBearerToken(StringSpan authorizationHeader, StringSpan& token)
566{
567 token = {};
568
569 HttpAuthorizationView authorization;
570 SC_TRY(authorization.parse(authorizationHeader));
571 SC_TRY_MSG(authorization.isBearer(), "Authorization scheme is not Bearer");
572 token = authorization.credentials;
573 return Result(true);
574}
575
576Result HttpParseBasicCredentials(StringSpan authorizationHeader, Span<char> storage, StringSpan& username,
577 StringSpan& password)

Callers 2

authorizationHelpersMethod · 0.85
outputResetMethod · 0.85

Calls 3

isBearerMethod · 0.80
ResultClass · 0.50
parseMethod · 0.45

Tested by 2

authorizationHelpersMethod · 0.68
outputResetMethod · 0.68