Commit eb173dbd authored by Łukasz Nowak's avatar Łukasz Nowak

Resend headers only if send.

parent ff4ef999
...@@ -103,8 +103,10 @@ def responseSupport(anonymous=False): ...@@ -103,8 +103,10 @@ def responseSupport(anonymous=False):
def outer(fn): def outer(fn):
def wrapperResponseSupport(self, *args, **kwargs): def wrapperResponseSupport(self, *args, **kwargs):
self.REQUEST.response.setHeader('Content-Type', 'application/json') self.REQUEST.response.setHeader('Content-Type', 'application/json')
self.REQUEST.response.setHeader('Access-Control-Allow-Headers', allow_headers = self.REQUEST.getHeader('Access-Control-Allow-Headers')
self.REQUEST.getHeader('Access-Control-Allow-Headers')) if allow_headers:
self.REQUEST.response.setHeader('Access-Control-Allow-Headers',
allow_headers)
self.REQUEST.response.setHeader('Access-Control-Allow-Origin', '*') self.REQUEST.response.setHeader('Access-Control-Allow-Origin', '*')
self.REQUEST.response.setHeader('Access-Control-Allow-Methods', 'DELETE, PUT, POST, ' self.REQUEST.response.setHeader('Access-Control-Allow-Methods', 'DELETE, PUT, POST, '
'GET, OPTIONS') 'GET, OPTIONS')
......
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