diff --git a/src/AppInstallerCommonCore/FileCache.cpp b/src/AppInstallerCommonCore/FileCache.cpp index 4038baa3ab..1594445d44 100644 --- a/src/AppInstallerCommonCore/FileCache.cpp +++ b/src/AppInstallerCommonCore/FileCache.cpp @@ -210,8 +210,11 @@ namespace AppInstaller::Caching return result; } - std::unique_ptr FileCache::GetUpstreamFile(const std::string& relativePath, const Utility::SHA256::HashBuffer& expectedHash) const + std::unique_ptr FileCache::GetUpstreamFile(std::string relativePath, const Utility::SHA256::HashBuffer& expectedHash) const { + // Replace backslashes with forward slashes for HTTP requests (since local can handle them). + Utility::FindAndReplace(relativePath, "\\", "/"); + std::exception_ptr firstException; for (const auto& upstream : m_sources) diff --git a/src/AppInstallerCommonCore/Public/winget/FileCache.h b/src/AppInstallerCommonCore/Public/winget/FileCache.h index 1bea547d56..59d1826f3b 100644 --- a/src/AppInstallerCommonCore/Public/winget/FileCache.h +++ b/src/AppInstallerCommonCore/Public/winget/FileCache.h @@ -53,7 +53,7 @@ namespace AppInstaller::Caching private: // Gets a stream containing the contents of the requested file from an upstream source. // The hash must match for this function to return successfully. - std::unique_ptr GetUpstreamFile(const std::string& relativePath, const Utility::SHA256::HashBuffer& expectedHash) const; + std::unique_ptr GetUpstreamFile(std::string relativePath, const Utility::SHA256::HashBuffer& expectedHash) const; Details m_details; std::vector m_sources;