Skip to content

Commit

Permalink
[#2425] Key error on resource proxy
Browse files Browse the repository at this point in the history
Old requests versions use to return None if a header was not present
  • Loading branch information
amercader committed May 11, 2015
1 parent 3fbebd0 commit 88d0e4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/resourceproxy/controller.py
Expand Up @@ -36,7 +36,7 @@ def proxy_resource(context, data_dict):
did_get = True
r.raise_for_status()

cl = r.headers['content-length']
cl = r.headers.get('content-length')
if cl and int(cl) > MAX_FILE_SIZE:
base.abort(409, '''Content is too large to be proxied. Allowed
file size: {allowed}, Content-Length: {actual}.'''.format(
Expand Down

0 comments on commit 88d0e4d

Please sign in to comment.