From 43c89141a4a4be29be32c2ec5d9c07ea337ff62f Mon Sep 17 00:00:00 2001 From: "Gordon Lam (SH)" Date: Wed, 11 Feb 2026 18:23:43 +0800 Subject: [PATCH] fix(HttpClient): take Uri by value in request() to prevent dangling reference The coroutine suspends at co_await, so a const-ref to a temporary Uri would dangle. Take by value like the download() overloads already do. --- src/common/utils/HttpClient.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utils/HttpClient.h b/src/common/utils/HttpClient.h index 0158e163b7..ff9b47917f 100644 --- a/src/common/utils/HttpClient.h +++ b/src/common/utils/HttpClient.h @@ -22,7 +22,7 @@ namespace http headers.UserAgent().TryParseAdd(USER_AGENT); } - winrt::Windows::Foundation::IAsyncOperation request(const winrt::Windows::Foundation::Uri& url) + winrt::Windows::Foundation::IAsyncOperation request(winrt::Windows::Foundation::Uri url) { auto response = co_await m_client.GetAsync(url); (void)response.EnsureSuccessStatusCode();