Internal QUICHE change
PiperOrigin-RevId: 326763993
Change-Id: Ia4048ca373908d5b8a8ebd5287bf8a6efc3b6c2f
diff --git a/quic/core/quic_crypto_server_stream.cc b/quic/core/quic_crypto_server_stream.cc
index 37beaba..665cae1 100644
--- a/quic/core/quic_crypto_server_stream.cc
+++ b/quic/core/quic_crypto_server_stream.cc
@@ -410,9 +410,8 @@
quiche::QuicheStringPiece user_agent_id;
message.GetStringPiece(quic::kUAID, &user_agent_id);
- if (!session()->user_agent_id().has_value()) {
- std::string uaid = user_agent_id.empty() ? "" : user_agent_id.data();
- session()->SetUserAgentId(std::move(uaid));
+ if (!session()->user_agent_id().has_value() && !user_agent_id.empty()) {
+ session()->SetUserAgentId(std::string(user_agent_id));
}
if (!result->info.server_nonce.empty()) {