Stiffstream / restinio

Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.15k stars 93 forks source link

There should be for_each_value_of method in http_header_fields_t class #111

Closed eao197 closed 4 years ago

eao197 commented 4 years ago

For now http_header_fields_t class contains only methods for getting the value of a single occurrence of a field (like get_field, try_get_field, get_field_or, value_of, opt_value_of). But HTTP-fields can be repeated in a HTTP message. To handle such repeated fields it's necessary to have something like that:

headers.for_each_value_of(
   restinio::http_field_t::accept,
   [](restinio::string_view_t value) {...});
...
headers.for_each_value_of(
   "Accept",
   [](restinio::string_view_t value) {...});