Ensure mimetype is sent to github

This commit is contained in:
Kovid Goyal 2020-06-20 13:02:34 +05:30
parent eb4ee2f0af
commit f62e2374e4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -257,7 +257,7 @@ class GitHub(Base): # {{{
% (asset['name'], release['tag_name']))
def do_upload(self, url: str, path: str, desc: str, fname: str) -> requests.Response:
mime_type = mimetypes.guess_type(fname)[0]
mime_type = mimetypes.guess_type(fname)[0] or 'application/octet-stream'
self.info('Uploading to GitHub: %s (%s)' % (fname, mime_type))
with ReadFileWithProgressReporting(path) as f:
return self.requests.post(