Skip to content

Commit dee0d94

Browse files
committed
Do a deepcopy to ensure we match sessions
1 parent a4f29ef commit dee0d94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

starlette_plus/middleware/sessions.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from __future__ import annotations
1717

1818
import base64
19+
import copy
1920
import datetime
2021
import hashlib
2122
import json
@@ -121,7 +122,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
121122
except (KeyError, itsdangerous.BadSignature):
122123
session = {}
123124

124-
original: dict[str, Any] = session.copy()
125+
original: dict[str, Any] = copy.deepcopy(session)
125126
scope["session"] = session
126127

127128
async def wrapper(message: Message) -> None:

0 commit comments

Comments
 (0)