vary¶
Manipulate HTTP Vary headers for polycpp.
polycpp::vary is a C++20 companion port of the npm vary package. It
keeps the pure header-string append behavior and adapts Node response-object
mutation to polycpp::http::Headers or explicit response-like C++ handles.
#include <polycpp/vary/vary.hpp>
auto header = polycpp::vary::append("Accept", "Origin");
Pure append helper
Append one field, a comma-separated field string, or an ordered field
vector to an existing Vary header.
Polycpp HTTP integration
Mutate polycpp::http::Headers or a polycpp::http::ServerResponse-
style object instead of inventing a local header abstraction.
Case preserving
Duplicate checks are case-insensitive while output preserves existing and newly appended field casing.
Star semantics
Vary: * and field * behave like upstream and dominate all other
fields.
Getting started¶
include(FetchContent)
FetchContent_Declare(
polycpp_vary
GIT_REPOSITORY https://github.com/polycpp/vary.git
GIT_TAG master
)
FetchContent_MakeAvailable(polycpp_vary)
target_link_libraries(my_app PRIVATE polycpp::vary)
Installation | Quickstart | Tutorial | API reference