##// END OF EJS Templates
http-app: simplify detection of chunked encoding....
marcink -
r1654:e02d85cd stable
parent child Browse files
Show More
@@ -126,6 +126,11 b' class VcsHttpProxy(object):'
126 return _maybe_stream_response(response)
126 return _maybe_stream_response(response)
127
127
128
128
129 def _is_request_chunked(environ):
130 stream = environ.get('HTTP_TRANSFER_ENCODING', '') == 'chunked'
131 return stream
132
133
129 def _maybe_stream_request(environ):
134 def _maybe_stream_request(environ):
130 path = environ['PATH_INFO']
135 path = environ['PATH_INFO']
131 stream = _is_request_chunked(environ)
136 stream = _is_request_chunked(environ)
@@ -137,15 +142,6 b' def _maybe_stream_request(environ):'
137 return environ['wsgi.input'].read()
142 return environ['wsgi.input'].read()
138
143
139
144
140 def _is_request_chunked(environ):
141 stream = environ.get('HTTP_TRANSFER_ENCODING', '') == 'chunked'
142 if not stream:
143 # git lfs should stream for PUT requests which are upload
144 stream = ('git-lfs' in environ.get('HTTP_USER_AGENT', '')
145 and environ['REQUEST_METHOD'] == 'PUT')
146 return stream
147
148
149 def _maybe_stream_response(response):
145 def _maybe_stream_response(response):
150 """
146 """
151 Try to generate chunks from the response if it is chunked.
147 Try to generate chunks from the response if it is chunked.
General Comments 0
You need to be logged in to leave comments. Login now