| 602 | } |
| 603 | |
| 604 | Result HttpWriteBearerAuthorization(StringSpan token, Span<char> storage, StringSpan& output) |
| 605 | { |
| 606 | output = {}; |
| 607 | size_t offset = 0; |
| 608 | SC_TRY_MSG(not token.isEmpty(), "Bearer authorization token is empty"); |
| 609 | SC_TRY_MSG(HttpHeaderInternal::appendTo(storage, offset, "Bearer "), "Authorization output buffer is too small"); |
| 610 | SC_TRY_MSG(HttpHeaderInternal::appendTo(storage, offset, token), "Authorization output buffer is too small"); |
| 611 | output = {{storage.data(), offset}, false, StringEncoding::Ascii}; |
| 612 | return Result(true); |
| 613 | } |
| 614 | |
| 615 | Result HttpWriteBasicAuthorization(StringSpan base64Credentials, Span<char> storage, StringSpan& output) |
| 616 | { |