03-Partial_Content.patch revision 3998
3998N/A--- glance-2014.2.2/glance/api/v2/image_data.py.~1~ 2015-02-05 07:19:44.000000000 -0800
3998N/A+++ glance-2014.2.2/glance/api/v2/image_data.py 2015-02-23 14:04:17.091921881 -0800
3998N/A@@ -199,6 +199,8 @@ class ResponseSerializer(wsgi.JSONRespon
3998N/A range_val = response.request.get_content_range()
3998N/A@@ -210,6 +212,21 @@ class ResponseSerializer(wsgi.JSONRespon
3998N/A if range_val.stop is not None:
3998N/A chunk_size = range_val.stop - offset
3998N/A+ response.status_int = 206
3998N/A+ range_obj = response.request.get_range()
3998N/A+ if range_obj.start is not None:
3998N/A+ offset = range_obj.start
3998N/A+ if range_obj.end is not None:
3998N/A+ chunk_size = range_obj.end - offset
3998N/A+ response.status_int = 206
3998N/A@@ -229,7 +246,9 @@ class ResponseSerializer(wsgi.JSONRespon
3998N/A #NOTE(markwash): "response.app_iter = ..." also erroneously resets the
3998N/A+ # NOTE(mattk): Should be set to chunk_size or image.size
3998N/A+ response.headers['Content-Length'] = \
3998N/A+ str(chunk_size) if chunk_size != 0 else str(image.size)
3998N/A response.status_int = 204
3998N/A--- glance-2014.2.2/glance/common/wsgi.py.~1~ 2015-02-05 07:19:44.000000000 -0800
3998N/A+++ glance-2014.2.2/glance/common/wsgi.py 2015-02-23 14:04:17.092284573 -0800
3998N/A@@ -556,7 +556,7 @@ class Request(webob.Request):
3998N/A return self.accept_language.best_match(langs)
3998N/A range_str = self.headers.get('Content-Range')
3998N/A range_ = webob.byterange.ContentRange.parse(range_str)
3998N/A@@ -565,6 +565,16 @@ class Request(webob.Request):
3998N/A raise webob.exc.HTTPBadRequest(explanation=msg)
3998N/A+ range_str = self.headers.get('Range')
3998N/A+ range_ = webob.byterange.Range.parse(range_str)
3998N/A+ raise webob.exc.HTTPBadRequest(explanation=msg)