Skip to content

Commit

Permalink
Use JSON mimetype for GitHub release source archives
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Sep 23, 2024
1 parent 6e532e3 commit 749e4de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Netkan/Transformers/GithubTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ private Metadata TransformOne(Metadata metadata,
json.SafeAdd("author", () => GetAuthors(ghRepo, ghRelease));
json.Remove("$kref");
json.SafeAdd("download", ghAsset.Download.ToString());
if (ghRef.UseSourceArchive)
{
// https://docs.github.com/en/rest/repos/contents#download-a-repository-archive-zip
// GitHub requires clients to specify JSON format
// to download a source ZIP (!!!)
json.SafeAdd("download_content_type",
"application/vnd.github+json");
}
json.SafeAdd(Metadata.UpdatedPropertyName, ghAsset.Updated);

if (ghRef.Project.Contains('_'))
Expand Down

0 comments on commit 749e4de

Please sign in to comment.