diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-12 11:38:51 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-21 08:12:25 +0100 |
commit | 7c552c0bd76a4bb0292bbdf694d0ce4ba65de0a7 (patch) | |
tree | c2ed234420daf606832902b8d3f3e83a0208f373 | |
parent | 74af60bb32f9009b838f7acee73c9a6cca2be265 (diff) | |
download | mediagoblin-7c552c0bd76a4bb0292bbdf694d0ce4ba65de0a7.tar.lz mediagoblin-7c552c0bd76a4bb0292bbdf694d0ce4ba65de0a7.tar.xz mediagoblin-7c552c0bd76a4bb0292bbdf694d0ce4ba65de0a7.zip |
plugins/api: use headers.set(), not headers.update()
The werkzeug.Response().headers do not offer an update() method as
the same key can be twice in the header 'dict'. Thus, iterate over
the header keys and use header.set(key, value) which replaces an
existing header key.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
-rw-r--r-- | mediagoblin/plugins/api/tools.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mediagoblin/plugins/api/tools.py b/mediagoblin/plugins/api/tools.py index c4073d23..333a5682 100644 --- a/mediagoblin/plugins/api/tools.py +++ b/mediagoblin/plugins/api/tools.py @@ -71,7 +71,7 @@ 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.update(cors_headers) + (response.headers.set(key, value) for key, value in cors_headers) return response |