swift/swift
Kota Tsuyuzaki 0e3e7b9b09 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
2018-05-23 04:07:32 +09:00
..
account Use check_drive consistently 2017-11-01 16:33:40 +00:00
cli py3: port cli form_signature and unit tests 2018-03-13 06:19:44 +00:00
common Fix versioned writes error with url-encoded object name 2018-05-23 04:07:32 +09:00
container add symlink to container sync default and sample config 2017-12-14 12:13:20 -08:00
locale Imported Translations from Zanata 2018-03-01 06:49:57 +00:00
obj Change object_audit_location_generator() to yield for a single policy. 2018-03-22 03:02:35 +00:00
proxy py3: port common/wsgi.py 2018-02-28 12:49:13 -05:00
__init__.py Make pbr a build-time only dependency 2013-10-29 12:29:49 -07:00