Comment 4 for bug 1755554

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/555245
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=0e3e7b9b0953baaf7a0686881fd2348fde7d1e59
Submitter: Zuul
Branch: master

commit 0e3e7b9b0953baaf7a0686881fd2348fde7d1e59
Author: Kota Tsuyuzaki <email address hidden>
Date: Thu Mar 22 19:26:24 2018 +0900

    Fix versioned writes error with url-encoded object name

    With url encoded object name like '%25ff' that can be url-encoded
    value after decoded can cause 412 Precondition Failed. And more,
    that can do nothing (no versioned object creation) even it returns
    a successful response.

    The root causes are in versioned_writes middleware as follows:

    A. unnecessary unquote in object_request method
    B. incorrect use of make_pre_authed_request that takes 'quoted'
       path in the args. That is described at [1] explicitely.

    This patch resolved those 2 bugs at once, and then, now we can create
    %25ff versioned object reported in the launchpad with this patch.

    Perhaps, more tests would be nice to have. This patch added a few
    test cases on that.

    1: https://github.com/openstack/swift/blob/master/swift/common/wsgi.py#L1174

    Note that make_subrequest and its caller should have *quoted* path but
    make_env should *NOT*. That might make us confused.

    Closes-Bug: #1755554

    Change-Id: Ibcd90cc633c68973929ee5249c6598c22b342e3e