4#include "../Common/Result.h"
5#include "../Common/Span.h"
6#include "../Common/StringSpan.h"
19 bool hasValue =
false;
42 StringSpan attributes;
51 StringSpan attributes;
59 bool hasMaxAge =
false;
61 bool httpOnly =
false;
63 Result parse(StringSpan setCookieHeader);
78 bool httpOnly =
false;
80 Result writeTo(Span<char> storage, StringSpan& output)
const;
85SC_HTTP_EXPORT StringSpan HttpContentTypeTextHtmlUtf8();
86SC_HTTP_EXPORT StringSpan HttpContentTypeApplicationJson();
87SC_HTTP_EXPORT StringSpan HttpContentTypeApplicationOctetStream();
92 uint32_t maxAgeSeconds = 0;
94 bool hasMaxAge =
false;
97 bool publicCache =
false;
98 bool privateCache =
false;
99 bool mustRevalidate =
false;
100 bool immutable =
false;
102 Result writeTo(Span<char> storage, StringSpan& output)
const;
109 StringSpan credentials;
111 Result parse(StringSpan authorizationHeader);
112 bool isBearer()
const;
113 bool isBasic()
const;
121 StringSpan& username, StringSpan& password);
131 Span<char> storage, StringSpan& output);
SC_HTTP_EXPORT StringSpan HttpContentTypeTextPlainUtf8()
Common Content-Type header values.
SC_HTTP_EXPORT Result HttpWriteBasicAuthorizationCredentials(StringSpan username, StringSpan password, Span< char > storage, StringSpan &output)
Writes Basic <base64(username:password)> into caller-provided storage.
SC_HTTP_EXPORT Result HttpParseBasicCredentials(StringSpan authorizationHeader, Span< char > storage, StringSpan &username, StringSpan &password)
Parses Basic Authorization credentials into caller-provided decoded storage.
SC_HTTP_EXPORT Result HttpWriteBasicAuthorization(StringSpan base64Credentials, Span< char > storage, StringSpan &output)
Writes Basic <base64Credentials> into caller-provided storage.
SC_HTTP_EXPORT Result HttpParseBearerToken(StringSpan authorizationHeader, StringSpan &token)
Parses a Bearer Authorization header and returns the raw token slice.
SC_HTTP_EXPORT Result HttpWriteBearerAuthorization(StringSpan token, Span< char > storage, StringSpan &output)
Writes Bearer <token> into caller-provided storage.
Zero-copy view of an Authorization header split into scheme and credentials.
Definition HttpHeaders.h:107
Writes a Cache-Control header value into caller-provided storage.
Definition HttpHeaders.h:91
Iterates a request Cookie header as semicolon-delimited name/value pairs.
Definition HttpHeaders.h:24
Iterates semicolon-delimited Set-Cookie attributes after the first name/value pair.
Definition HttpHeaders.h:36
Writes a Set-Cookie header value into caller-provided storage.
Definition HttpHeaders.h:68
Zero-copy view of one Set-Cookie header value.
Definition HttpHeaders.h:48