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

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

StrFormat() understands std::string, std::string_view

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot]
2025-06-26 11:41:48 -05:00
committed by GitHub
parent 79d6160bdc
commit 4268bf91e4
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);