diff options
author | shabbyrobe <code@shabbyrobe.org> | 2016-05-26 17:48:09 +1000 |
---|---|---|
committer | shabbyrobe <code@shabbyrobe.org> | 2016-05-26 17:48:09 +1000 |
commit | 28b0ae5a3863aa0e58eada8db344ae25685139a1 (patch) | |
tree | abb55299ff165e7ad20a0d402dd5b2b10f070b6a /service/pixelated/resources | |
parent | ee5b5198e89f23cd49d41dc58fb93443b5d8c9e1 (diff) |
Updated calls to addRawHeader to use setRawHeaders
Diffstat (limited to 'service/pixelated/resources')
-rw-r--r-- | service/pixelated/resources/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/service/pixelated/resources/__init__.py b/service/pixelated/resources/__init__.py index 9ccca7ee..cd27fab0 100644 --- a/service/pixelated/resources/__init__.py +++ b/service/pixelated/resources/__init__.py @@ -36,14 +36,14 @@ class SetEncoder(json.JSONEncoder): def respond_json(entity, request, status_code=200): json_response = json.dumps(entity, cls=SetEncoder) - request.responseHeaders.addRawHeader(b"content-type", [b"application/json"]) + request.responseHeaders.setRawHeaders(b"content-type", [b"application/json"]) request.code = status_code return json_response def respond_json_deferred(entity, request, status_code=200): json_response = json.dumps(entity, cls=SetEncoder) - request.responseHeaders.addRawHeader(b"content-type", [b"application/json"]) + request.responseHeaders.setRawHeaders(b"content-type", [b"application/json"]) request.code = status_code request.write(json_response) request.finish() |