Merge pull request #9572 from dgquintas/interop_server_mac_slice_crash

Fixed invalid handling of slice data in interop_server
pull/9580/head
David G. Quintas 8 years ago committed by GitHub
commit f538e15ca5
  1. 4
      test/cpp/interop/interop_server.cc

@ -106,7 +106,9 @@ void MaybeEchoMetadata(ServerContext* context) {
if (iter != client_metadata.end()) { if (iter != client_metadata.end()) {
iter = client_metadata.find("user-agent"); iter = client_metadata.find("user-agent");
if (iter != client_metadata.end()) { if (iter != client_metadata.end()) {
context->AddInitialMetadata(kEchoUserAgentKey, iter->second.data()); context->AddInitialMetadata(
kEchoUserAgentKey,
grpc::string(iter->second.begin(), iter->second.end()));
} }
} }
} }

Loading…
Cancel
Save