Fixes issue of swift3 middleware not working correctly with '/' in object names

This commit is contained in:
Chuck Thier 2011-05-05 21:07:53 +00:00 committed by Tarmac
commit 6d0f925f0a
2 changed files with 1 additions and 11 deletions

View File

@ -426,7 +426,7 @@ class Swift3Middleware(object):
self.app = app
def get_controller(self, path):
container, obj = split_path(path, 0, 2)
container, obj = split_path(path, 0, 2, True)
d = dict(container_name=container, object_name=obj)
if container and obj:

View File

@ -207,16 +207,6 @@ class TestSwift3(unittest.TestCase):
code = dom.getElementsByTagName('Code')[0].childNodes[0].nodeValue
self.assertEquals(code, 'InvalidArgument')
def test_bad_path(self):
req = Request.blank('/bucket/object/bad',
environ={'REQUEST_METHOD': 'GET'},
headers={'Authorization': 'AWS test:tester:hmac'})
resp = self.app(req.environ, start_response)
dom = xml.dom.minidom.parseString("".join(resp))
self.assertEquals(dom.firstChild.nodeName, 'Error')
code = dom.getElementsByTagName('Code')[0].childNodes[0].nodeValue
self.assertEquals(code, 'InvalidURI')
def test_bad_method(self):
req = Request.blank('/',
environ={'REQUEST_METHOD': 'PUT'},