← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1624508] [NEW] Glance raises a HTTPBadRequest instead of HTTPRequestRangeNotSatisfiable (400 instead of 416)

 

Public bug reported:

Currently when range requests are given as a part of the HTTP header request for partial downloads of Glance images, a call to the method ``get_content_range()`` in glance/common/wsgi.py is made.
If the request range is not satisfiable (For example a bad range like 2-4/3 or 2-/3), the ``get_content_range()`` method raises a 400 instead of a 416.

Since this method deals only with parsing and returning the content
range header, it is more appropriate for it to raise a
HTTPRequestRangeNotSatisfiable with a status code of 416 instead of a
400.

File:
https://github.com/openstack/glance/blob/master/glance/common/wsgi.py#L975-L983

** Affects: glance
     Importance: Undecided
     Assignee: Dharini Chandrasekar (dharini-chandrasekar)
         Status: New

** Changed in: glance
     Assignee: (unassigned) => Dharini Chandrasekar (dharini-chandrasekar)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1624508

Title:
  Glance raises a HTTPBadRequest instead of
  HTTPRequestRangeNotSatisfiable (400 instead of 416)

Status in Glance:
  New

Bug description:
  Currently when range requests are given as a part of the HTTP header request for partial downloads of Glance images, a call to the method ``get_content_range()`` in glance/common/wsgi.py is made.
  If the request range is not satisfiable (For example a bad range like 2-4/3 or 2-/3), the ``get_content_range()`` method raises a 400 instead of a 416.

  Since this method deals only with parsing and returning the content
  range header, it is more appropriate for it to raise a
  HTTPRequestRangeNotSatisfiable with a status code of 416 instead of a
  400.

  File:
  https://github.com/openstack/glance/blob/master/glance/common/wsgi.py#L975-L983

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1624508/+subscriptions


Follow ups