Browse Source

Correct erroneous conversion of x-fetch-since into integer, bump head to 0.7.5

Daniel Gruno 1 week ago
parent
commit
b609502df8
2 changed files with 5 additions and 2 deletions
  1. 3 0
      CHANGELOG.md
  2. 2 2
      pypubsub.py

+ 3 - 0
CHANGELOG.md

@@ -1,3 +1,6 @@
+# 0.7.5
+- Fixed an issue with conversion of the X-Fetch-Since header into an integer value (h/t Quinton Seeger for spotting this)
+
 # 0.7.4
 - Added support for TLS (HTTPS) on a separate port.
 

+ 2 - 2
pypubsub.py

@@ -36,7 +36,7 @@ import signal
 import uuid
 
 # Some consts
-PUBSUB_VERSION = '0.7.4'
+PUBSUB_VERSION = '0.7.5'
 PUBSUB_CONTENT_TYPE = 'application/vnd.pypubsub-stream'
 PUBSUB_DEFAULT_PORT = 2069
 PUBSUB_DEFAULT_IP = '0.0.0.0'
@@ -262,7 +262,7 @@ class Server:
                 cursor_based_backlog = request.headers.get('X-Fetch-Since-Cursor')
                 if epoch_based_backlog:  # epoch-based backlog search
                     try:
-                        backlog_ts = int(backlog)
+                        backlog_ts = int(epoch_based_backlog)
                     except ValueError:  # Default to 0 if we can't parse the epoch
                         backlog_ts = 0
                     # If max age is specified, force the TS to minimum that age