Skip to content

Commit ebb149d

Browse files
committed
Fixed GetProxyUri() to return a reference
2 parents e5fed4c + ac2ecc7 commit ebb149d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/AppInstallerCommonCore/MSStoreDownload.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ namespace AppInstaller::MSStore
913913
sfsClientRequest.productRequests = { {std::string{ wuCategoryId }, {}} };
914914
if (AppInstaller::Settings::Network().GetProxyUri())
915915
{
916-
std::string proxyUri = AppInstaller::Settings::Network().GetProxyUri().value();
916+
const auto& proxyUri = AppInstaller::Settings::Network().GetProxyUri().value();
917917

918918
sfsClientRequest.proxy = proxyUri;
919919
AICLI_LOG(Core, Info, << "Passing proxy to SFS client " << proxyUri);

src/AppInstallerCommonCore/Public/winget/NetworkSettings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace AppInstaller::Settings
1616
{
1717
static NetworkSettings& Instance();
1818

19-
const std::optional<std::string> GetProxyUri() const { return m_proxyUri; }
19+
const std::optional<std::string>& GetProxyUri() const { return m_proxyUri; }
2020
// Sets the proxy URI; may do nothing depending on admin settings and group policy
2121
void SetProxyUri(const std::optional<std::string>& proxyUri);
2222

@@ -30,4 +30,4 @@ namespace AppInstaller::Settings
3030
};
3131

3232
NetworkSettings& Network();
33-
}
33+
}

0 commit comments

Comments
 (0)