Index: sitescripts/notifications/web/notification.py |
=================================================================== |
--- a/sitescripts/notifications/web/notification.py |
+++ b/sitescripts/notifications/web/notification.py |
@@ -61,8 +61,7 @@ |
if "notifications" not in response: |
response["notifications"] = [x for x in notifications |
if "variants" not in x] |
- return json.dumps(response, ensure_ascii=False, indent=2, |
- separators=(",", ": "), sort_keys=True) |
+ return response |
@url_handler("/notification.json") |
def notification(environ, start_response): |
@@ -81,6 +80,10 @@ |
if not groups: |
groups = _assign_groups(notifications) |
response = _create_response(notifications, groups) |
- start_response("200 OK", |
- [("Content-Type", "application/json; charset=utf-8")]) |
- return response.encode("utf-8") |
+ response_headers = [("Content-Type", "application/json; charset=utf-8"), |
+ ("ABP-Notification-Version", response["version"])] |
+ response_body = json.dumps(response, ensure_ascii=False, indent=2, |
+ separators=(",", ": "), |
+ sort_keys=True).encode("utf-8") |
+ start_response("200 OK", response_headers) |
+ return response_body |