mirror of
				https://github.com/laurivosandi/certidude
				synced 2025-10-31 01:19:11 +00:00 
			
		
		
		
	api: Use nchan headers for pushing events
This commit is contained in:
		| @@ -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,7 +28,7 @@ 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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user