mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user