Commit 962b2042 authored by Łukasz Nowak's avatar Łukasz Nowak

Support Access-Control-Allow-Headers.

parent 9ef0000a
...@@ -49,6 +49,8 @@ def jsonResponse(fn): ...@@ -49,6 +49,8 @@ def jsonResponse(fn):
def responseSupport(fn): def responseSupport(fn):
def wrapper(self, *args, **kwargs): def wrapper(self, *args, **kwargs):
response = self.REQUEST.response response = self.REQUEST.response
response.setHeader('Access-Control-Allow-Headers',
self.REQUEST.getHeader('Access-Control-Allow-Headers'))
response.setHeader('Access-Control-Allow-Origin', '*') response.setHeader('Access-Control-Allow-Origin', '*')
response.setHeader('Access-Control-Allow-Methods', 'DELETE, PUT, POST, ' response.setHeader('Access-Control-Allow-Methods', 'DELETE, PUT, POST, '
'GET, OPTIONS') 'GET, OPTIONS')
...@@ -67,6 +69,8 @@ class GenericPublisher(Implicit): ...@@ -67,6 +69,8 @@ class GenericPublisher(Implicit):
def OPTIONS(self, *args, **kwargs): def OPTIONS(self, *args, **kwargs):
"""HTTP OPTIONS implementation""" """HTTP OPTIONS implementation"""
response = self.REQUEST.response response = self.REQUEST.response
response.setHeader('Access-Control-Allow-Headers',
self.REQUEST.get('Access-Control-Allow-Headers'))
response.setHeader('Access-Control-Allow-Origin', '*') response.setHeader('Access-Control-Allow-Origin', '*')
response.setHeader('Access-Control-Allow-Methods', 'DELETE, PUT, POST, ' 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