Skip to content

Commit

Permalink
Improve header retrieval and logging (#3680) (#3686)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMcPMS authored Sep 27, 2023
1 parent 3cdf58e commit aa15b54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AppInstallerCommonCore/Downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace AppInstaller::Utility

for (const auto& header : response.Headers())
{
result.emplace(Utility::ConvertToUTF8(header.Key()), Utility::ConvertToUTF8(header.Value()));
result.emplace(Utility::FoldCase(static_cast<std::string_view>(Utility::ConvertToUTF8(header.Key()))), Utility::ConvertToUTF8(header.Value()));
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,22 @@ namespace AppInstaller::Repository::Microsoft
AICLI_LOG(Repo, Verbose, << "Header indicates version is: " << itr->second);
return { itr->second };
}

// We did not find the header we were looking for, log the ones we did find
AICLI_LOG(Repo, Verbose, << "Did not find " << s_PreIndexedPackageSourceFactory_PackageVersionHeader << " in:\n" << [&]()
{
std::ostringstream headerLog;
for (const auto& header : headers)
{
headerLog << " " << header.first << " : " << header.second << '\n';
}
return std::move(headerLog).str();
}());
}
CATCH_LOG();
}

AICLI_LOG(Repo, Verbose, << "No version header, falling back to reading the package data");
AICLI_LOG(Repo, Verbose, << "Falling back to reading the package data");
Msix::MsixInfo info{ packageLocation };
auto manifest = info.GetAppPackageManifests();

Expand Down

0 comments on commit aa15b54

Please sign in to comment.