aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/api/tools.py
diff options
context:
space:
mode:
authorRunar Petursson <runar@betur.com>2013-02-15 10:17:24 +0800
committerJoar Wandborg <joar@wandborg.se>2013-02-20 23:41:36 +0100
commit9b2cd962af78ce8fbe2bce88d7b9d3a9d01e4aa9 (patch)
tree4e9484e0557102f2176d3fdf012cbe7015930869 /mediagoblin/plugins/api/tools.py
parent155438cdc1da0e00996eebca97cb6581f06811e3 (diff)
downloadmediagoblin-9b2cd962af78ce8fbe2bce88d7b9d3a9d01e4aa9.tar.lz
mediagoblin-9b2cd962af78ce8fbe2bce88d7b9d3a9d01e4aa9.tar.xz
mediagoblin-9b2cd962af78ce8fbe2bce88d7b9d3a9d01e4aa9.zip
plugins/api: fix for cross origin requests
The response headers were never getting set because of a bug in the 7c552c0 commit. This expands the loop into a more readable form and results in the headers getting set.
Diffstat (limited to 'mediagoblin/plugins/api/tools.py')
-rw-r--r--mediagoblin/plugins/api/tools.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mediagoblin/plugins/api/tools.py b/mediagoblin/plugins/api/tools.py
index e5878258..92411f4b 100644
--- a/mediagoblin/plugins/api/tools.py
+++ b/mediagoblin/plugins/api/tools.py
@@ -69,7 +69,8 @@ def json_response(serializable, _disable_cors=False, *args, **kw):
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, X-Requested-With'}
- (response.headers.set(key, value) for key, value in cors_headers)
+ for key, value in cors_headers.iteritems():
+ response.headers.set(key, value)
return response