Make POST for bulk delete actually work
Change-Id: I568e7e31df3dcbeac20dba6d543a13c0409de00e Closes-Bug: 1232787
This commit is contained in:
parent
afe794ef22
commit
aae254df55
@ -331,6 +331,7 @@ class Bulk(object):
|
|||||||
new_env['PATH_INFO'] = delete_path
|
new_env['PATH_INFO'] = delete_path
|
||||||
del(new_env['wsgi.input'])
|
del(new_env['wsgi.input'])
|
||||||
new_env['CONTENT_LENGTH'] = 0
|
new_env['CONTENT_LENGTH'] = 0
|
||||||
|
new_env['REQUEST_METHOD'] = 'DELETE'
|
||||||
new_env['HTTP_USER_AGENT'] = \
|
new_env['HTTP_USER_AGENT'] = \
|
||||||
'%s %s' % (req.environ.get('HTTP_USER_AGENT'), user_agent)
|
'%s %s' % (req.environ.get('HTTP_USER_AGENT'), user_agent)
|
||||||
new_env['swift.source'] = swift_source
|
new_env['swift.source'] = swift_source
|
||||||
|
@ -64,7 +64,8 @@ class FakeApp(object):
|
|||||||
if len(env['PATH_INFO']) > 100:
|
if len(env['PATH_INFO']) > 100:
|
||||||
return Response(status='400 Bad Request')(env, start_response)
|
return Response(status='400 Bad Request')(env, start_response)
|
||||||
return Response(status='201 Created')(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'])
|
self.delete_paths.append(env['PATH_INFO'])
|
||||||
if len(env['PATH_INFO']) > self.max_pathlen:
|
if len(env['PATH_INFO']) > self.max_pathlen:
|
||||||
return Response(status='400 Bad Request')(env, start_response)
|
return Response(status='400 Bad Request')(env, start_response)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user