Have the configuration file request identify itself as coming from ArchInstall

This is necessary to allow proper filtering of these requests server-side, and some services block urllib requests (known issue with Cloudflare).
This commit is contained in:
Dylan M. Taylor 2021-05-19 18:16:28 -04:00 committed by GitHub
parent 182babf33a
commit 5b0f918d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ def initialize_arguments():
with open(args.config) as file:
config = json.load(file)
else: # Attempt to load the configuration from the URL.
with urllib.request.urlopen(args.config) as response:
with urllib.request.urlopen(urllib.request.Request(args.config, headers={'User-Agent': 'ArchInstall'})) as response:
config = json.loads(response.read())
except Exception as e:
print(e)