From 114e67ed6a404ad1a3589ce39a283fd3a0c43e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Wed, 17 Feb 2016 16:15:06 +0200 Subject: [PATCH] api: Use nchan headers for pushing events --- certidude/push.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/certidude/push.py b/certidude/push.py index a44a84a..52e0b7a 100644 --- a/certidude/push.py +++ b/certidude/push.py @@ -18,7 +18,7 @@ def publish(event_type, event_data): notification = urllib.request.Request( url, event_data.encode("utf-8"), - {"Event-ID": b"TODO", "Event-Type":event_type.encode("ascii")}) + {"X-EventSource-Event":event_type.encode("ascii")}) notification.add_header("User-Agent", "Certidude API") try: @@ -28,10 +28,10 @@ def publish(event_type, event_data): if err.code == 404: print("No subscribers on the channel") else: - raise + print("Failed to submit event, %s" % err) else: print("Push server returned:", response.code, body) - response.close() + response.close()