Skip to content

Commit 4d29125

Browse files
committed
Fix lazy data parsing in event mode
1 parent eaef895 commit 4d29125

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

uhttp/server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,10 @@ def headers(self):
781781

782782
@property
783783
def data(self):
784-
"""Content data"""
784+
"""Content data (parsed JSON/form or raw bytes)"""
785+
# Lazy parse buffer on EVENT_COMPLETE (after accept_body)
786+
if self._data is None and self._event == EVENT_COMPLETE and self._buffer:
787+
self._process_data()
785788
return self._data
786789

787790
@property

0 commit comments

Comments
 (0)