Skip to content

Commit ad31921

Browse files
committed
Clean: catch bad cookies
1 parent 41a0dac commit ad31921

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

bases/rsptx/assignment_server_api/routers/student.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ async def doAssignment(
342342
if RS_info:
343343
rslogger.debug(f"RS_info Cookie {RS_info}")
344344
# Note that to get to the value of the cookie you must use ``.value``
345-
parsed_js = json.loads(RS_info)
345+
try:
346+
parsed_js = json.loads(RS_info)
347+
except Exception as e:
348+
parsed_js = {}
346349
else:
347350
parsed_js = {}
348351
parsed_js["readings"] = readings_names

bases/rsptx/book_server_api/routers/rslogging.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ async def updatelastpage(
357357

358358
practice_settings = await fetch_course_practice(user.course_name)
359359
if RS_info:
360-
values = json.loads(RS_info)
360+
try:
361+
values = json.loads(RS_info)
362+
except:
363+
values = {}
361364

362365
tz_offset = float(values.get("tz_offset", 0))
363366
else:

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ services:
2323
- PGBOUNCER_AUTH_TYPE=trust #md5 or scram-sha-256
2424
- PGBOUNCER_DEFAULT_POOL_SIZE=30
2525
- PGBOUNCER_POOL_MODE=transaction
26+
- PGBOUNCER_MAX_PREPARED_STATEMENTS=100
27+
- PGBOUNCER_STATS_USERS=runestone
2628

2729

2830
jobe:

0 commit comments

Comments
 (0)