Skip to content

Commit

Permalink
modules/grpc: fix add_header
Browse files Browse the repository at this point in the history
std::tolower is not an addressible function,
the intended way to use it within a lambda.

See the following for more information:
https://devblogs.microsoft.com/oldnewthing/20241007-00/?p=110345
https://en.cppreference.com/w/cpp/string/byte/tolower

Signed-off-by: Szilard Parrag <[email protected]>
  • Loading branch information
OverOrion committed Oct 11, 2024
1 parent ccbab69 commit 399e99a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/grpc/common/grpc-dest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ class DestDriver

void add_header(std::string name, std::string value)
{
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
std::transform(name.begin(), name.end(), name.begin(),
[](auto c)
{
return ::tolower(c);
});
this->headers.push_back(std::make_pair(name, value));
}

Expand Down

0 comments on commit 399e99a

Please sign in to comment.