Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
http::h2::detail Namespace Reference

Classes

struct  HeaderBlock
 Owns the header name/value strings backing an nghttp2_nv list. More...
 

Functions

HeaderBlock build_response_headers (const http::HttpResponse &response)
 Builds the HTTP/2 response header list for a response.
 
bool parse_method (std::string_view value, http::HttpMethod &out)
 Maps an HTTP/2 :method pseudo-header value to an HttpMethod.
 
bool is_connection_specific_header (std::string_view name)
 True if a header is forbidden in HTTP/2 and must not be forwarded.
 

Function Documentation

◆ build_response_headers()

HeaderBlock http::h2::detail::build_response_headers ( const http::HttpResponse response)

Builds the HTTP/2 response header list for a response.

Emits the mandatory :status pseudo-header first, then each response header with its name lowercased as HTTP/2 requires. Connection-specific headers that are forbidden in HTTP/2 (RFC 9113 section 8.2.2) are dropped.

Parameters
responseThe response whose headers should be encoded.
Returns
A HeaderBlock owning the encoded names/values and the nv list.

◆ is_connection_specific_header()

bool http::h2::detail::is_connection_specific_header ( std::string_view  name)

True if a header is forbidden in HTTP/2 and must not be forwarded.

Parameters
nameThe header name, in any case.

◆ parse_method()

bool http::h2::detail::parse_method ( std::string_view  value,
http::HttpMethod out 
)

Maps an HTTP/2 :method pseudo-header value to an HttpMethod.

Parameters
valueThe :method value as received on the wire.
outSet to the parsed method on success; untouched on failure.
Returns
True if the method was recognised.