refactor: remove stray .c_str() calls for absl::StrFormat() (#47548)

refactor: remove stray .c_str() calls for absl::StrFormat()

StrFormat() understands std::string, std::string_view
This commit is contained in:
Charles Kerr
2025-06-26 04:41:30 -05:00
committed by GitHub
parent 7a274a711c
commit f50ad3d022
10 changed files with 27 additions and 34 deletions

View File

@@ -394,7 +394,7 @@ void ProxyingURLLoaderFactory::InProgressRequest::
"HTTP/1.1 %i Internal Redirect\n"
"Location: %s\n"
"Non-Authoritative-Reason: WebRequest API\n\n",
kInternalRedirectStatusCode, redirect_url_.spec().c_str());
kInternalRedirectStatusCode, redirect_url_.spec());
// Cross-origin requests need to modify the Origin header to 'null'. Since
// CorsURLLoader sets |request_initiator| to the Origin request header in

View File

@@ -142,8 +142,7 @@ void ProxyingWebSocket::OnConnectionEstablished(
base::MakeRefCounted<net::HttpResponseHeaders>(absl::StrFormat(
"HTTP/%d.%d %d %s", handshake_response_->http_version.major_value(),
handshake_response_->http_version.minor_value(),
handshake_response_->status_code,
handshake_response_->status_text.c_str()));
handshake_response_->status_code, handshake_response_->status_text));
for (const auto& header : handshake_response_->headers)
response_->headers->AddHeader(header->name, header->value);