Browse Source

Important fix to open_url. HTTP Request object was being created inside if headers is None block - now corrected to create regardless.

git-svn-id: http://proj.badc.rl.ac.uk/svn/ndg-security/trunk/ndg_httpsclient@8191 051b1e3e-aa0c-0410-b6c2-bfbade6052be
pjkersha 12 years ago
parent
commit
ee7d8ca1a8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ndg/httpsclient/utils.py

+ 2 - 1
ndg/httpsclient/utils.py

@@ -183,7 +183,8 @@ def open_url(url, config, data=None, handlers=None):
     headers = config.headers
     headers = config.headers
     if headers is None: 
     if headers is None: 
         headers = {}
         headers = {}
-        request = urllib2.Request(url, data, headers)
+        
+    request = urllib2.Request(url, data, headers)
 
 
     # Open the URL and check the response.
     # Open the URL and check the response.
     return_code = 0
     return_code = 0