Commit 75fd4e9d authored by Łukasz Nowak's avatar Łukasz Nowak

responseSupport decorator obsoletes prepareResponse

parent 8c834702
...@@ -69,21 +69,13 @@ class GenericPublisher(Implicit): ...@@ -69,21 +69,13 @@ class GenericPublisher(Implicit):
subpath.reverse() subpath.reverse()
request.set('traverse_subpath', subpath) request.set('traverse_subpath', subpath)
def prepareResponse(self):
response = self.REQUEST.response
response.setHeader('Content-Type', 'application/json; charset=utf-8')
response.setHeader('Access-Control-Allow-Origin', '*')
response.setHeader('Access-Control-Allow-Methods', 'DELETE, PUT, POST, '
'GET, OPTIONS')
return response
class InstancePublisher(GenericPublisher): class InstancePublisher(GenericPublisher):
"""Instance publisher""" """Instance publisher"""
@responseSupport @responseSupport
def DELETE(self, *args, **kwargs): def DELETE(self, *args, **kwargs):
"""HTTP DELETE implementation""" """HTTP DELETE implementation"""
response = self.prepareResponse() response = self.REQUEST.response
try: try:
instance_id = self.REQUEST['traverse_subpath'][0] instance_id = self.REQUEST['traverse_subpath'][0]
except IndexError: except IndexError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment