add user-agent header to be nice
authorJann Horn <jann@thejh.net>
Mon, 2 Sep 2024 01:10:55 +0000 (03:10 +0200)
committerJann Horn <jann@thejh.net>
Mon, 2 Sep 2024 01:10:55 +0000 (03:10 +0200)
main.py

diff --git a/main.py b/main.py
index 16533ea..228f587 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -420,7 +420,10 @@ def app(environ, start_response):
     if msgid != '':
         http_conn = http.client.HTTPSConnection('lore.kernel.org')
         try:
-            http_conn.request('GET', '/all/'+quote(msgid, safe='')+'/t.mbox.gz', headers={'Host': 'lore.kernel.org'})
+            http_conn.request('GET', '/all/'+quote(msgid, safe='')+'/t.mbox.gz', headers={
+                'Host': 'lore.kernel.org',
+                'User-Agent': 'https://mehlbrei.thejh.net/'
+            })
             http_resp = http_conn.getresponse()
             if http_resp.status != 200:
                 out.append('lore.kernel.org returned '+str(http_resp.status)+' '+html.escape(http_resp.reason, quote=False))