Skip to content

Commit

Permalink
Use PUPGUI_GHA_TOKEN if present to set Authorization for STL download…
Browse files Browse the repository at this point in the history
… headers
  • Loading branch information
sonic2kk committed Aug 26, 2022
1 parent f158d04 commit 1e8c640
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pupgui2/resources/ctmods/ctmod_steamtinkerlaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def __download(self, url, destination):
"""
try:
# Need extra headers to get content-length
file = self.rs.get(url, stream=True, headers={'Accept-Encoding': None, 'Content-Encoding': 'gzip'})
stl_headers = {'Accept-Encoding': None, 'Content-Encoding': 'gzip'}
token = os.getenv('PUPGUI_GHA_TOKEN')
if token:
stl_headers['Authorization'] = f'token {token}'
file = self.rs.get(url, stream=True, headers=stl_headers)
except OSError:
return False

Expand Down

0 comments on commit 1e8c640

Please sign in to comment.