Skip to content

Commit

Permalink
Merge pull request #24 from deep-compute/response_headers_propery
Browse files Browse the repository at this point in the history
Property headers in response
  • Loading branch information
Ram Idavalapati authored May 16, 2019
2 parents aadb996 + 0488e8d commit 11a0766
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ deploy:
skip_cleanup: true
api_key:
secure: mWdLXjWAbioxRdJ0XGFYm6WeV90W+ZaabQHCjlnFVX576hJqyQabs9pkHoF/VnanecEtoOVzt7cZdmZQ+mNoZgbSE+90iGZosZO0GZFX7MjhxYw5bJOUmRr9L+/6cV7v+XEE8cFQTFCQgMPycWOjvnyuRixLGDVn/l1MeUc84xpSD7T4XwIZlwX9YB6fKAtvuz9vq5xQwV8mJOtIWN3NqlVuhdew7WkUdq0eiRK5dm1G05o/tiKfxCI+76fyRr6FLmzs7WH/CS5spbMpr6bv9iBirOYK57Jr5xdS1zE4mnwaJ8vIubbjO7BN4H8AjwdMzUBF96X2nRVRluGi0sGbbBEQiGCOg2Qtjb3udGaekmPYF6DRwQZMhBtvsd2B31gIhRps2qQigiZUfqnWr3p4Uoua5+2yOfVJUuHxbBLvlag4qbfGr1LZg/lRt58WGydtwfqXuKVlEUyhQvqd7AGfwVOVRW3ezmpqerMRNSHzkf+XnuB/A3/7FEY1xdMbez6yDqxbp8Jm7qmscwnt+7SR14Ur63jSv+qeact6z9H60mFCOWO5533rtfNDIHO6Av7N+IgeOG8i30K+OgWWa2vXWqrjrBEttFs0qi9O3PAMImXkw/iiHlCYkFDDwyTZCzYUQA1LiBP5q+8IfEj8up58NxM6wvB1TrVi2jEq29GHX3Y=
name: kwikapi.tornado-0.3.6
tag_name: 0.3.6
name: kwikapi.tornado-0.3.7
tag_name: 0.3.7
on:
repo: deep-compute/kwikapi.tornado
- provider: pypi
Expand Down
10 changes: 7 additions & 3 deletions kwikapi/tornado/kwikapi_tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TornadoResponse(BaseResponse):
def __init__(self, req_hdlr):
super().__init__()
self._req_hdlr = req_hdlr
self.headers = CaseInsensitiveDict()
self._headers = CaseInsensitiveDict()

def write(self, data, proto, stream=False):
n, t = super().write(data, proto, stream=stream)
Expand All @@ -62,9 +62,9 @@ def write(self, data, proto, stream=False):
gfile.close()
self._data = compressed.getvalue()
nbytes = len(self._data)
self.headers['Content-Encoding'] = 'gzip'
self._headers['Content-Encoding'] = 'gzip'

self.headers['Content-Length'] = nbytes
self._headers['Content-Length'] = nbytes

self._stream = stream

Expand All @@ -76,6 +76,10 @@ def flush(self):
def close(self):
pass

@property
def headers(self):
return self._headers

class RequestHandler(TornadoRequestHandler):
PROTOCOL = BaseRequestHandler.DEFAULT_PROTOCOL

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

# https://docs.djangoproject.com/en/1.11/intro/reusable-apps/
version = '0.3.6'
version = '0.3.7'
setup(
name="kwikapi-tornado",
version=version,
Expand Down

0 comments on commit 11a0766

Please sign in to comment.