Redirect processing doesn't work

Bug #1231524 reported by Russell Bryant on 2013-09-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-glanceclient
Undecided
Russell Bryant

Bug Description

The code for processing an HTTP redirect has the following code:

         elif resp.status in (301, 302, 305):
             # Redirected. Reissue the request to the new location.
             return self._http_request(resp['location'], method, **kwargs)

The problem is the way it tries to get the location header. HTTPResponse doesn't support this. You have to call the getheader() method on the response, instead.

Changed in python-glanceclient:
assignee: nobody → Russell Bryant (russellb)

Related fix proposed to branch: master
Review: https://review.openstack.org/48480

Changed in python-glanceclient:
status: New → In Progress

Reviewed: https://review.openstack.org/48480
Committed: http://github.com/openstack/python-glanceclient/commit/471863581114a5cabc50392f17033ed04a79f37d
Submitter: Jenkins
Branch: master

commit 471863581114a5cabc50392f17033ed04a79f37d
Author: Russell Bryant <email address hidden>
Date: Thu Sep 26 11:42:16 2013 -0400

    Fix default value for a header

    This code specified None as the default value, but it would raise an
    exception if that was ever returned. An empty string causes the code to
    work as intended.

    This came up while I was writing a unit test for another bug fix.

    Change-Id: I658bb8a9b5124f281988fb60b645182ea0ccf99f
    Related-bug: #1231524

Reviewed: https://review.openstack.org/48481
Committed: http://github.com/openstack/python-glanceclient/commit/50266eec2b86aaa0a7717adf004576d444f4fce9
Submitter: Jenkins
Branch: master

commit 50266eec2b86aaa0a7717adf004576d444f4fce9
Author: Russell Bryant <email address hidden>
Date: Thu Sep 26 11:43:29 2013 -0400

    Fix getting header in redirect processing

    The code for processing an HTTP redirect included an incorrect method of
    getting the Location header from an HTTPResponse. It needs to use the
    getheader() method on the response, instead. This patch fixes that and
    includes a unit test that covers this code path.

    Change-Id: I0952fabad581b020dee07bdc4007b55b47c906aa
    Closes-Bug: #1231524

Changed in python-glanceclient:
status: In Progress → Fix Committed
Louis Taylor (kragniz) on 2014-09-21
Changed in python-glanceclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers