From a4262d7484735f7b7edf918f2f6aa48a0055dcc3 Mon Sep 17 00:00:00 2001 From: oldnapalm <38410858+oldnapalm@users.noreply.github.com> Date: Wed, 16 Dec 2020 17:41:05 -0300 Subject: [PATCH] Fix map selection for single player --- initialize_db.sql | 2 -- standalone.py | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/initialize_db.sql b/initialize_db.sql index 0a4ff9f..cf63167 100644 --- a/initialize_db.sql +++ b/initialize_db.sql @@ -1,7 +1,5 @@ CREATE TABLE version ( version INTEGER ); -INSERT INTO version VALUES (2); - /* column names must match protobuf field names */ CREATE TABLE activity ( diff --git a/standalone.py b/standalone.py index 12cc184..3c44c95 100755 --- a/standalone.py +++ b/standalone.py @@ -183,7 +183,9 @@ class CDNHandler(SimpleHTTPRequestHandler): # We have no identifying information when Zwift makes MapSchedule request except for the client's IP. MAP_OVERRIDE.append((self.client_address[0], path_end)) self.send_response(302) - self.send_header('Cookie', self.headers.get('Cookie') + "; map=%s" % path_end) + cookie = self.headers.get('Cookie') + if cookie: + self.send_header('Cookie', cookie + "; map=%s" % path_end) self.send_header('Location', 'https://secure.zwift.com/ride') self.end_headers() return