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

Function HttpWriteBearerAuthorization

Libraries/Http/HttpHeaders.cpp:604–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602
603 size_t decodedSize = 0;
604 SC_TRY(HttpHeaderInternal::decodeBase64(authorization.credentials, storage, decodedSize));
605 size_t colonIndex = static_cast<size_t>(-1);
606 for (size_t idx = 0; idx < decodedSize; ++idx)
607 {
608 if (storage.data()[idx] == ':')
609 {
610 colonIndex = idx;
611 break;
612 }
613 }
614 if (colonIndex == static_cast<size_t>(-1))
615 return Result::Error(HttpResultCategory, HttpError::BasicPasswordSeparatorMissing);
616

Callers 1

headerBuildersMethod · 0.85

Calls 3

ResultClass · 0.50
isEmptyMethod · 0.45
dataMethod · 0.45

Tested by 1

headerBuildersMethod · 0.68