Skip to content

Commit

Permalink
accept application/x-zip-compressed and application/zip as valid cont…
Browse files Browse the repository at this point in the history
…entypes for app updates
  • Loading branch information
Insire committed Mar 9, 2021
1 parent eea5f47 commit 5541004
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Dawn/Dawn.Wpf/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ namespace Dawn.Wpf
{
public sealed class ShellViewModel : ViewModelBase
{
private const string ZipContentType = "application/x-zip-compressed";
private const string ZipCompressedContentType = "application/x-zip-compressed";
private const string ZipContentType = "application/zip";

private const string ZipDownloadType = "application/octet-stream";
private const string GithubRepositoryOwner = "insire";

Expand Down Expand Up @@ -131,7 +133,7 @@ private async Task CheckForApplicationUpdate(CancellationToken token)

_log.Write(Serilog.Events.LogEventLevel.Information, "An update ({release}) is available", latest.TagName);

_asset = latest.Assets.FirstOrDefault(p => p.ContentType == ZipContentType);
_asset = latest.Assets.FirstOrDefault(p => p.ContentType == ZipContentType || p.ContentType == ZipCompressedContentType);

return;
}
Expand Down Expand Up @@ -273,7 +275,7 @@ private async Task<bool> DownloadRelease(string to, CancellationToken token)

private bool CanGetApplicationUpdate()
{
return !_hasUpdatedApplication;
return !_hasUpdatedApplication && _asset != null;
}

private void MoveFile(string from, string to)
Expand Down

0 comments on commit 5541004

Please sign in to comment.