WithSecureLabs/drozer

Fix latest version checks

cyberMilosz opened this issue · 0 comments

Our latest version check currently relies on a file that never existed, does not exist, and will never exist:

def latest_version():
try:
xml = urlopen(Request("https://www.withsecure.com/products/drozer/community-edition/manifest.xml", None, {"user-agent": "drozer: %s" % version}), None, 1).read()
doc = ElementTree.fromstring(xml)
return max(map(lambda n: Version(n.text[1:], n.attrib['release_date']), doc.findall('version')))
except HTTPError:
return None
except URLError:
return None

Let's use something that exists instead - like the GitHub API! Should be as simple as parsing https://api.github.com/repos/WithSecureLabs/drozer/releases/latest