Skip to content

Commit

Permalink
req->res
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Nov 12, 2012
1 parent c9735dc commit 706f053
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ckanext/resourceproxy/controller.py
Expand Up @@ -14,13 +14,13 @@ def proxy_resource(context, data_dict):
resource = logic.get_action('resource_show')(context, {'id': resource_id})
url = resource['url']
try:
req = urllib2.urlopen(url)
res = urllib2.urlopen(url)
except urllib2.URLError, error:
req = error
base.response.headers = req.headers
res = error
base.response.headers = res.headers

import shutil
shutil.copyfileobj(req, base.response)
shutil.copyfileobj(res, base.response)


class ProxyController(base.BaseController):
Expand Down

0 comments on commit 706f053

Please sign in to comment.