Reviewed: https://review.openstack.org/367528 Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=400230cd9d72f00caf6c1d5824da906ea335a1ad Submitter: Jenkins Branch: master
commit 400230cd9d72f00caf6c1d5824da906ea335a1ad Author: Dharini Chandrasekar <dharini.chandrase...@intel.com> Date: Thu Sep 8 17:03:40 2016 +0000 Handling HTTP range requests in Glance Currently Glance does not send Partial response codes while handling HTTP range requests. Also, content length is not appropriately set. This patch is to send partial response code and to set the correct content length based on the range request for image download. Upon success status code 206 is sent and the content length is set to the requested range. Upon failure, there can be 2 cases: * If the HTTP range request for the image download is bad (For example, requesting download of range of bytes 10 to 50 bytes when there are only 48 bytes), status code is set to 416 and HTTPRequestRangeNotSatisfiable is raised. * If the content range is valid, but the request is not satisfiable due to glance_store side erros or privacy issues, appropriate exceptions are raised. APIImpact DocImpact Closes-Bug: #1417069 Closes-Bug: #1624508 Closes-Bug: #1399851 Closes-Bug: #1618928 Change-Id: I3cd47b998be79604511b3cd4879209820cf776b7 ** Changed in: glance Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/1417069 Title: Glance does not support HTTP Range requests Status in Glance: Fix Released Bug description: Glance API currently does not support Range requests regardless of whether the underlying glance_store driver supports it or not. For instance if using the Glance V2 API you should be able to use following curl command to request the first 32 bytes a of the glance stored image: # curl -i -X GET -r 0-32 -H "X-Auth-Token: $token" $image_url/v2/images/{image_id}/file This places the HTTP header "Range: bytes=0-32" into the request. Glance currently ignores this and always returns then entire image. Glance does have some build in knowledge of Content-Range requests, which is different. Glance should also return 206 Partial Content when returning a range, See bug https://bugs.launchpad.net/glance/+bug/1399851. Attached is a patch to glance which provides Range specific support and also returns 206 as per fix from above bug. To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1417069/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp