Parcourir la source

Change content-type to application/vnd.pypubsub-stream

Daniel Gruno il y a 5 ans
Parent
commit
b5be287b61
2 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 5 0
      CHANGELOG.md
  2. 2 4
      pypubsub.py

+ 5 - 0
CHANGELOG.md

@@ -1,3 +1,6 @@
+# 0.4.6
+- Changed content type to better reflect that this is a custom stream
+
 # 0.4.5
 - Better handling of errored subscriber connections
 
@@ -21,3 +24,5 @@
 
 # 0.3.0
 - Initial public release.
+
+0ly0b

+ 2 - 4
pypubsub.py

@@ -29,7 +29,7 @@ import argparse
 import plugins.ldap
 
 # Some consts
-PUBSUB_VERSION = '0.4.5'
+PUBSUB_VERSION = '0.4.6'
 PUBSUB_BAD_REQUEST = "I could not understand your request, sorry! Please see https://pubsub.apache.org/api.html \
 for usage documentation.\n"
 PUBSUB_PAYLOAD_RECEIVED = "Payload received, thank you very much!\n"
@@ -117,9 +117,7 @@ class Server:
                 subscriber.acl = await subscriber.parse_acl(auth)
 
             self.subscribers.append(subscriber)
-            # We'll change the content type once we're ready
-            # resp.content_type = 'application/vnd.apache-pubsub-stream'
-            resp.content_type = 'application/json'
+            resp.content_type = 'application/vnd.pypubsub-stream'
             try:
                 resp.enable_chunked_encoding()
                 await resp.prepare(request)