Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from utils.helpers import *
import time
import json
import html

# --- Flask Application Setup ---
app = Flask(__name__)
Expand Down Expand Up @@ -99,6 +100,9 @@ def run_simulation_stream():
if not is_valid:
return result

# Escape result to prevent XSS
result = html.escape(result)

# Build command
command = build_simulation_command(result)
logger.debug(f"Running streaming simulation with command: {' '.join(command)}")
Expand Down
4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Modification Notice: simulation.hpp
## Modification Notice: `simulation.hpp`

This document describes a modification made to the `simulation.hpp` file, specifically in the `Simulator::printRow` function. The purpose of this change is to enable real-time streaming of simulation output when used with the API, ensuring that data is delivered to the client as soon as it is available.

Expand Down Expand Up @@ -29,4 +29,4 @@ void Simulator::printRow(double percentage) {

### Future Considerations

If future versions of the library include this feature, this modification may no longer be necessary. Until then, it should be retained to ensure proper streaming behavior.
If future versions of the library include this feature, this modification may no longer be necessary. Until then, it should be retained to ensure proper streaming behavior.
Loading