Skip to content

Commit

Permalink
Changes in http feature
Browse files Browse the repository at this point in the history
  • Loading branch information
xchwarze committed Feb 25, 2023
1 parent e201b45 commit 97bb34d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file modified updater.exe
Binary file not shown.
7 changes: 5 additions & 2 deletions updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import colorama
import tqdm
import urllib
import binascii


# Helpers functions
Expand Down Expand Up @@ -248,10 +249,12 @@ def _check_version_from_http(self, headers):

remote_version = None
if 'last-modified' in headers:
remote_version = headers['last-modified']
input_bytes = headers['last-modified'].encode()
remote_version = str(binascii.crc32(input_bytes))
elif 'content-length' in headers:
print('{0}: using "content-length" as version number...'.format(self.name))
remote_version = headers['content-length']
input_bytes = headers['content-length'].encode()
remote_version = str(binascii.crc32(input_bytes))
else:
raise Exception(colorama.Fore.RED + '{0}: no header is found with which to determine if there is an update'.format(self.name))

Expand Down

0 comments on commit 97bb34d

Please sign in to comment.