Comment 0 for bug 1762997

Revision history for this message
Christopher Bartz (bartz) wrote : dlo does not work when segments container contains a '?'

It is possible to create a DLO Manifest with a segments container containing a question mark inside. E.g.

curl -XPUT ... -H"x-object-manifest: a%3Fcontainer/prefix"

But if this DLO Object should be retrieved (GET or HEAD), a 404 (or incorrect 2xx) is returned.

The reason lies in the DLO Middleware: It unquotes the container [1], but does not quote it again when doing the container listing [2]. Thus the internal container listing request looks like this in the proxy log:

Apr 11 12:24:21 swift proxy-server: - - 11/Apr/2018/10/24/21 GET /v1/AUTH_account/a%3Fformat%3Djson%26prefix%3Dprefix HTTP/1.0 404

(be aware that the log line is quoted again)

This means the container listing is done on the container called "a" and not "a?container". If this container does not exist, a 404 is returned. If the container does exist, an incorrect 2xx response would be returned.

[1] https://github.com/openstack/swift/blob/master/swift/common/middleware/dlo.py#L233
[2] https://github.com/openstack/swift/blob/master/swift/common/middleware/dlo.py#L147