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.
Reviewed: https:/ /review. openstack. org/555245 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=0e3e7b9b095 3baaf7a0686881f d2348fde7d1e59
Committed: https:/
Submitter: Zuul
Branch: master
commit 0e3e7b9b0953baa f7a0686881fd234 8fde7d1e59
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 authed_ request that takes 'quoted'
B. incorrect use of make_pre_
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: Ibcd90cc633c689 73929ee5249c659 8c22b342e3e