Skip to content

Commit

Permalink
replace backslashes as Kestrel may not like them
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMcPMS committed May 8, 2024
1 parent 07daa84 commit f8466ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/AppInstallerCommonCore/FileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,11 @@ namespace AppInstaller::Caching
return result;
}

std::unique_ptr<std::stringstream> FileCache::GetUpstreamFile(const std::string& relativePath, const Utility::SHA256::HashBuffer& expectedHash) const
std::unique_ptr<std::stringstream> 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)
Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCommonCore/Public/winget/FileCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::stringstream> GetUpstreamFile(const std::string& relativePath, const Utility::SHA256::HashBuffer& expectedHash) const;
std::unique_ptr<std::stringstream> GetUpstreamFile(std::string relativePath, const Utility::SHA256::HashBuffer& expectedHash) const;

Details m_details;
std::vector<std::string> m_sources;
Expand Down

0 comments on commit f8466ab

Please sign in to comment.