Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-05-21 09:29:50 +0200
committerGitHub <noreply@github.com>2021-05-21 09:29:50 +0200
commit54a693be4fa2fbce83fd894b5ac3b0909f3a1e10 (patch)
tree142241293ffbc4ab0ffd6a750fae4d10d1538822 /archinstall/lib
parent60cdb2ab8725a9001768473d90bfd189ada577f9 (diff)
parentac2b1084e83407d4acf5ae9820ff1ea7290519fc (diff)
Merge pull request #495 from dylanmtaylor/patch-1
Add ArchInstall user-agent to mirror requests
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/mirrors.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/archinstall/lib/mirrors.py b/archinstall/lib/mirrors.py
index a7ed7da3..ccfc2808 100644
--- a/archinstall/lib/mirrors.py
+++ b/archinstall/lib/mirrors.py
@@ -16,7 +16,7 @@ def filter_mirrors_by_region(regions, destination='/etc/pacman.d/mirrorlist', *a
region_list = []
for region in regions.split(','):
region_list.append(f'country={region}')
- response = urllib.request.urlopen(f"https://archlinux.org/mirrorlist/?{'&'.join(region_list)}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on'")
+ response = urllib.request.urlopen(urllib.request.Request(f"https://archlinux.org/mirrorlist/?{'&'.join(region_list)}&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on'", headers={'User-Agent': 'ArchInstall'}))
new_list = response.read().replace(b"#Server", b"Server")
with open(destination, "wb") as mirrorlist:
mirrorlist.write(new_list)