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.
This commit is contained in:
Gordon Lam (SH)
2026-02-11 18:23:43 +08:00
parent f2f17eb0f0
commit 43c89141a4

View File

@@ -22,7 +22,7 @@ namespace http
headers.UserAgent().TryParseAdd(USER_AGENT);
}
winrt::Windows::Foundation::IAsyncOperation<winrt::hstring> request(const winrt::Windows::Foundation::Uri& url)
winrt::Windows::Foundation::IAsyncOperation<winrt::hstring> request(winrt::Windows::Foundation::Uri url)
{
auto response = co_await m_client.GetAsync(url);
(void)response.EnsureSuccessStatusCode();