Merge "Make POST for bulk delete actually work"
This commit is contained in:
commit
13563e3d87
@ -335,6 +335,7 @@ class Bulk(object):
|
||||
new_env['PATH_INFO'] = delete_path
|
||||
del(new_env['wsgi.input'])
|
||||
new_env['CONTENT_LENGTH'] = 0
|
||||
new_env['REQUEST_METHOD'] = 'DELETE'
|
||||
new_env['HTTP_USER_AGENT'] = \
|
||||
'%s %s' % (req.environ.get('HTTP_USER_AGENT'), user_agent)
|
||||
new_env['swift.source'] = swift_source
|
||||
|
@ -68,7 +68,8 @@ class FakeApp(object):
|
||||
if len(env['PATH_INFO']) > 100:
|
||||
return Response(status='400 Bad Request')(env, start_response)
|
||||
return Response(status='201 Created')(env, start_response)
|
||||
if env['PATH_INFO'].startswith('/delete_works/'):
|
||||
if (env['PATH_INFO'].startswith('/delete_works/')
|
||||
and env['REQUEST_METHOD'] == 'DELETE'):
|
||||
self.delete_paths.append(env['PATH_INFO'])
|
||||
if len(env['PATH_INFO']) > self.max_pathlen:
|
||||
return Response(status='400 Bad Request')(env, start_response)
|
||||
|
Loading…
x
Reference in New Issue
Block a user