Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #255 from marco-santamaria/urllib2-proxy-patch
Let urllib2 get proxies if set in the environment variables
  • Loading branch information
alculquicondor committed Sep 12, 2016
2 parents 67e0bec + c38e5ff commit 6ebb2d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TileStache/Providers.py
Expand Up @@ -254,8 +254,9 @@ def renderTile(self, width, height, srs, coord):
img = None
urls = self.provider.getTileUrls(coord)

# Explicitly tell urllib2 to get no proxies
proxy_support = urllib2.ProxyHandler({})
# Tell urllib2 get proxies if set in the environment variables <protocol>_proxy
# see: https://docs.python.org/2/library/urllib2.html#urllib2.ProxyHandler
proxy_support = urllib2.ProxyHandler()
url_opener = urllib2.build_opener(proxy_support)

for url in urls:
Expand Down

0 comments on commit 6ebb2d5

Please sign in to comment.