Skip to content

Commit 4206905

Browse files
committed
Ensure edit events from visual editor is only processed in debug mode
1 parent 2dcde0c commit 4206905

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mesop/server/server.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ def generate_data(ui_request: pb.UiRequest) -> Generator[str, None, None]:
105105
# one's local computer
106106
if request.remote_addr not in LOCALHOSTS:
107107
abort(403) # Throws a Forbidden Error
108-
108+
# Visual editor should only be enabled in debug mode.
109+
if not runtime().debug_mode:
110+
abort(403) # Throws a Forbidden Error
109111
handle_editor_event(ui_request.editor_event)
110112
yield "data: <stream_end>\n\n"
111113
else:

0 commit comments

Comments
 (0)