From c561b61cbabdf58da43be1197e71eddb8d86394c Mon Sep 17 00:00:00 2001 From: Jover Lee Date: Wed, 27 Nov 2024 10:27:02 -0800 Subject: [PATCH] fetch-docs: Add User-Agent to session Adding User-Agent as an attempt to fix the 403 Client Errors returned from requests to GitHub. --- src/fetch-docs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fetch-docs.py b/src/fetch-docs.py index 985212b0..57b1f296 100755 --- a/src/fetch-docs.py +++ b/src/fetch-docs.py @@ -27,6 +27,9 @@ if __name__ == '__main__': # Use a Session for connection pooling session = requests.Session() + session.headers.update({ + "User-Agent": "https://github.com/nextstrain/docs.nextstrain.org (hello@nextstrain.org)", + }) class RemoteDoc: def __init__(self, source_url, dest_path):