changeset 164:4d8218fbe686

merged
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Dec 2014 14:34:48 +0100
parents 1d63a532ccce (current diff) 5df0bef667ea (diff)
children c3243555ed09
files farol/main.py
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Tue Dec 30 14:34:21 2014 +0100
+++ b/CHANGES	Tue Dec 30 14:34:48 2014 +0100
@@ -1,3 +1,10 @@
+Farol next
+=======================
+
+Main changes since 1.0.1:
+-------------------------
+* Set the User-Agent to external requests to a non-default value.
+
 Farol 1.0.1 (2014-11-17)
 ========================
 
--- a/farol/main.py	Tue Dec 30 14:34:21 2014 +0100
+++ b/farol/main.py	Tue Dec 30 14:34:48 2014 +0100
@@ -110,6 +110,11 @@
     )
 
 def download_url(url):
+    request = urllib2.Request(url)
+    request.add_header('User-Agent',
+                       app.config.get('USER_AGENT',
+                                      'Farol %s / FarolLuz %s' % (
+        __version__, farolluz.__version__)))
     proxy_host = app.config.get('PROXY_HOST', '')
     if proxy_host:
         proxy = urllib2.ProxyHandler({'http': proxy_host, 'https': proxy_host})

http://farol.wald.intevation.org