Mobrovac has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356870 )

Change subject: Set the User-Agent header field when doing requests
......................................................................

Set the User-Agent header field when doing requests

Change-Id: Idd18d9dd5f92b890d2b095332c5188b934bfcc73
---
M servicechecker/__init__.py
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/service-checker 
refs/changes/70/356870/1

diff --git a/servicechecker/__init__.py b/servicechecker/__init__.py
index 8db701c..f8e5101 100755
--- a/servicechecker/__init__.py
+++ b/servicechecker/__init__.py
@@ -69,6 +69,10 @@
         del kw['method']
     else:
         method = 'GET'
+    if 'headers' not in kw:
+        kw['headers'] = {}
+    if 'User-Agent' not in kw['headers']:
+        kw['headers']['User-Agent'] = 'ServiceChecker/WMF'
     try:
         if method == 'GET':
             return client.request(

-- 
To view, visit https://gerrit.wikimedia.org/r/356870
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd18d9dd5f92b890d2b095332c5188b934bfcc73
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/service-checker
Gerrit-Branch: master
Gerrit-Owner: Mobrovac <mobro...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to