Skip to content

Commit

Permalink
Resource proxy supports proxying files with http errors, i.e. a 404 p…
Browse files Browse the repository at this point in the history
…age.
  • Loading branch information
domoritz committed Nov 12, 2012
1 parent 2c87ae7 commit f1894d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckanext/resourceproxy/controller.py
Expand Up @@ -13,7 +13,10 @@ def proxy_resource(context, data_dict):
log.info('Proxify resource {id}'.format(id=resource_id))
resource = logic.get_action('resource_show')(context, {'id': resource_id})
url = resource['url']
req = urllib2.urlopen(url)
try:
req = urllib2.urlopen(url)
except urllib2.HTTPError, error:
req = error
base.response.headers = req.headers

import shutil
Expand Down

0 comments on commit f1894d3

Please sign in to comment.