changeset e05af58237dd in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=e05af58237dd
description:
Add Access-Control headers only on Response
The response may be a HTTPException which does not allow to customize
the
headers.
issue8047
review49761002
diffstat:
trytond/wsgi.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 2d01626c0431 -r e05af58237dd trytond/wsgi.py
--- a/trytond/wsgi.py Wed Jan 30 10:05:55 2019 +0100
+++ b/trytond/wsgi.py Wed Jan 30 10:07:38 2019 +0100
@@ -130,7 +130,7 @@
else:
response = data
- if origin:
+ if origin and isinstance(response, Response):
response.headers['Access-Control-Allow-Origin'] = origin
response.headers['Vary'] = 'Origin'
method = request.headers.get('Access-Control-Request-Method')