Skip to content

Commit

Permalink
Remove chunked warning
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed Mar 20, 2018
1 parent c954dc4 commit 1051964
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions ckanext/ngsiview/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

log = getLogger(__name__)

MAX_FILE_SIZE = 1024 * 1024 # 1MB
CHUNK_SIZE = 512


Expand Down Expand Up @@ -96,15 +95,6 @@ def proxy_ngsi_resource(context, data_dict):
base.response.content_type = r.headers['content-type']
base.response.charset = r.encoding

cl = r.headers.get('content-length')
if cl is None:
base.abort(409, 'This proxy did not support chunked responses')

if int(cl) > MAX_FILE_SIZE:
base.abort(409, '''Content is too large to be proxied. Allowed
file size: {allowed}, Content-Length: {actual}.'''.format(
allowed=MAX_FILE_SIZE, actual=cl))

for chunk in r.iter_content(chunk_size=CHUNK_SIZE):
base.response.body_file.write(chunk)

Expand Down

0 comments on commit 1051964

Please sign in to comment.