10#include <grpcpp/support/string_ref.h>
11#include <boost/range/adaptor/map.hpp>
12#include <boost/range/adaptor/transformed.hpp>
14#include <userver/ugrpc/server/rpc.hpp>
15#include <userver/utils/assert.hpp>
16#include <userver/utils/text.hpp>
18USERVER_NAMESPACE_BEGIN
26 UASSERT(field_name == utils::text::ToLower(field_name));
28 auto [it_begin, it_end] = metadata.equal_range(grpc::string_ref(field_name.data(), field_name.length()));
30 using Metadata = std::multimap<grpc::string_ref, grpc::string_ref>;
31 return boost::iterator_range<Metadata::const_iterator>(it_begin, it_end) |
32 boost::adaptors::transformed([](
const std::pair<
const grpc::string_ref, grpc::string_ref>& entry) {
33 return std::string_view(entry.second.begin(), entry.second.length());