Skip to content

Commit

Permalink
use ckan abort from base instead of pylons abort due to lucid bug
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Nov 25, 2012
1 parent b3c01b2 commit 1a5803a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ckanext/resourceproxy/controller.py
Expand Up @@ -2,8 +2,6 @@
import shutil
from logging import getLogger

from pylons.controllers.util import abort as abort

import ckan.logic as logic
import ckan.lib.base as base

Expand All @@ -24,14 +22,14 @@ def proxy_resource(context, data_dict):
had_http_error = True
except urllib2.URLError, error:
details = "Could not proxy resource. " + str(error.reason)
abort(500, detail=details)
base.abort(500, detail=details)
base.response.headers = res.headers

shutil.copyfileobj(res, base.response)

# todo only change the status code, not the whole content
if had_http_error and hasattr(res, 'code'):
abort(res.code)
base.abort(res.code)


class ProxyController(base.BaseController):
Expand Down

0 comments on commit 1a5803a

Please sign in to comment.